mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-11 11:31:52 +02:00
Fixed potentially uninitialized class member
This commit is contained in:
parent
e6dcf355e8
commit
dd88220b7c
@ -721,6 +721,11 @@ bool CGameInfoCallback::isPlayerMakingTurn(PlayerColor player) const
|
|||||||
return gs->actingPlayers.count(player);
|
return gs->actingPlayers.count(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGameInfoCallback::CGameInfoCallback():
|
||||||
|
gs(nullptr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
CGameInfoCallback::CGameInfoCallback(CGameState * GS):
|
CGameInfoCallback::CGameInfoCallback(CGameState * GS):
|
||||||
gs(GS)
|
gs(GS)
|
||||||
{
|
{
|
||||||
|
@ -134,7 +134,7 @@ class DLL_LINKAGE CGameInfoCallback : public IGameInfoCallback
|
|||||||
protected:
|
protected:
|
||||||
CGameState * gs;//todo: replace with protected const getter, only actual Server and Client objects should hold game state
|
CGameState * gs;//todo: replace with protected const getter, only actual Server and Client objects should hold game state
|
||||||
|
|
||||||
CGameInfoCallback() = default;
|
CGameInfoCallback();
|
||||||
CGameInfoCallback(CGameState * GS);
|
CGameInfoCallback(CGameState * GS);
|
||||||
bool hasAccess(std::optional<PlayerColor> playerId) const;
|
bool hasAccess(std::optional<PlayerColor> playerId) const;
|
||||||
|
|
||||||
|
@ -489,11 +489,6 @@ void CGameHandler::handleReceivedPack(CPackForServer * pack)
|
|||||||
vstd::clear_pointer(pack);
|
vstd::clear_pointer(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CGameHandler::CGameHandler()
|
|
||||||
: turnTimerHandler(*this)
|
|
||||||
{}
|
|
||||||
|
|
||||||
CGameHandler::CGameHandler(CVCMIServer * lobby)
|
CGameHandler::CGameHandler(CVCMIServer * lobby)
|
||||||
: lobby(lobby)
|
: lobby(lobby)
|
||||||
, heroPool(std::make_unique<HeroPoolProcessor>(this))
|
, heroPool(std::make_unique<HeroPoolProcessor>(this))
|
||||||
@ -518,6 +513,7 @@ CGameHandler::~CGameHandler()
|
|||||||
{
|
{
|
||||||
delete spellEnv;
|
delete spellEnv;
|
||||||
delete gs;
|
delete gs;
|
||||||
|
gs = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameHandler::reinitScripting()
|
void CGameHandler::reinitScripting()
|
||||||
|
@ -92,8 +92,7 @@ public:
|
|||||||
bool isAllowedExchange(ObjectInstanceID id1, ObjectInstanceID id2);
|
bool isAllowedExchange(ObjectInstanceID id1, ObjectInstanceID id2);
|
||||||
void giveSpells(const CGTownInstance *t, const CGHeroInstance *h);
|
void giveSpells(const CGTownInstance *t, const CGHeroInstance *h);
|
||||||
|
|
||||||
CGameHandler();
|
explicit CGameHandler(CVCMIServer * lobby);
|
||||||
CGameHandler(CVCMIServer * lobby);
|
|
||||||
~CGameHandler();
|
~CGameHandler();
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user