fix(Core/Unit): Fix CanSwim method not accurate for players (#17320)

This commit is contained in:
Mickaël Mauger
2023-09-23 20:49:20 +02:00
committed by GitHub
parent fb1d356af9
commit 1a84ab6983

View File

@@ -20224,7 +20224,7 @@ bool Unit::CanSwim() const
// Mirror client behavior, if this method returns false then client will not use swimming animation and for players will apply gravity as if there was no water
if (HasUnitFlag(UNIT_FLAG_CANNOT_SWIM))
return false;
if (HasUnitFlag(UNIT_FLAG_POSSESSED)) // is player
if (HasUnitFlag(UNIT_FLAG_POSSESSED) || HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) // is player
return true;
if (HasUnitFlag2(UNIT_FLAG2_UNUSED_6))
return false;