Core/Wintergrasp: fix possible crash when rebuild hits non rebuildable buildings
This commit is contained in:
@@ -1192,11 +1192,14 @@ struct BfWGGameObjectBuilding
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rebuild gameobject
|
// Rebuild gameobject
|
||||||
m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
|
if (m_Build->IsDestructibleBuilding())
|
||||||
|
{
|
||||||
|
m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
|
||||||
|
|
||||||
// Update worldstate
|
// Update worldstate
|
||||||
m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (m_Team * 3);
|
m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (m_Team * 3);
|
||||||
m_WG->SendUpdateWorldState(m_WorldState, m_State);
|
m_WG->SendUpdateWorldState(m_WorldState, m_State);
|
||||||
|
}
|
||||||
UpdateCreatureAndGo();
|
UpdateCreatureAndGo();
|
||||||
m_Build->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_Team]);
|
m_Build->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_Team]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user