mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[12061] Assert correct loading of GO_TYPE_CAPTURE_POINT
This will assert controlled behaviour when loading a `gameobject_template` entry of type Capture Point with bad data Patch improved by stfx Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
5a0f668515
commit
2a4b8f2cb0
2 changed files with 18 additions and 1 deletions
|
|
@ -5937,6 +5937,18 @@ inline void CheckGOConsumable(GameObjectInfo const* goInfo,uint32 dataN,uint32 N
|
|||
goInfo->id,goInfo->type,N,dataN);
|
||||
}
|
||||
|
||||
inline void CheckAndFixGOCaptureMinTime(GameObjectInfo const* goInfo, uint32 const& dataN, uint32 N)
|
||||
{
|
||||
if (dataN > 0)
|
||||
return;
|
||||
|
||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) has data%d=%u but minTime field value must be > 0.",
|
||||
goInfo->id, goInfo->type, N, dataN);
|
||||
|
||||
// prevent division through 0 exception
|
||||
const_cast<uint32&>(dataN) = 1;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGameobjectInfo()
|
||||
{
|
||||
SQLGameObjectLoader loader;
|
||||
|
|
@ -6099,6 +6111,11 @@ void ObjectMgr::LoadGameobjectInfo()
|
|||
CheckGONoDamageImmuneId(goInfo,goInfo->flagdrop.noDamageImmune,3);
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_CAPTURE_POINT: //29
|
||||
{
|
||||
CheckAndFixGOCaptureMinTime(goInfo, goInfo->capturePoint.minTime, 16);
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_BARBER_CHAIR: //32
|
||||
CheckAndFixGOChairHeightId(goInfo,goInfo->barberChair.chairheight,0);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12060"
|
||||
#define REVISION_NR "12061"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue