[AZTH-MS] try fix crash at get GetUInt32Value in CanCustomBuildValuesUpdate

This commit is contained in:
Winfidonarleyan
2019-08-31 15:22:42 +07:00
parent 8fc0abd728
commit 4e5be963f7

View File

@@ -1261,7 +1261,7 @@ public:
return true;
}
bool IsCustomBuildValuesUpdate(Unit const* unit, uint8 /*updateType*/, ByteBuffer& fieldBuffer, Player const* target, uint16 index) override
bool CanCustomBuildValuesUpdate(Unit const* unit, uint8 /*updateType*/, ByteBuffer& fieldBuffer, Player const* target, uint16 index) override
{
int repRank = sAzthUtils->getReaction(unit, target);
@@ -1280,11 +1280,13 @@ public:
}
else if (repRank <= REP_HOSTILE && ft1 && ft2 && ft1->IsFriendlyTo(*ft2))
fieldBuffer << (unit->GetUInt32Value(UNIT_FIELD_BYTES_2) | unit->GetUInt32Value(UNIT_BYTE2_FLAG_FFA_PVP << 8));
else
fieldBuffer << unit->GetUInt32Value(index);
return true;
return false;
}
return false;
return true;
}
};