File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ bool GamePlayer::IsHQTent() const
421421
422422void GamePlayer::SetHQIsTent (bool isTent)
423423{
424- if (nobHQ* hq = GetHQ ())
424+ if (nobHQ* hq = const_cast <nobHQ*>( GetHQ () ))
425425 hq->SetIsTent (isTent);
426426}
427427
@@ -1414,10 +1414,10 @@ void GamePlayer::TestDefeat()
14141414 Surrender ();
14151415}
14161416
1417- nobHQ* GamePlayer::GetHQ () const
1417+ const nobHQ* GamePlayer::GetHQ () const
14181418{
14191419 const MapPoint& hqPos = GetHQPos ();
1420- return const_cast <nobHQ*>( hqPos.isValid () ? GetGameWorld ().GetSpecObj <nobHQ>(hqPos) : nullptr ) ;
1420+ return hqPos.isValid () ? GetGameWorld ().GetSpecObj <nobHQ>(hqPos) : nullptr ;
14211421}
14221422
14231423void GamePlayer::Surrender ()
Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ class GamePlayer : public GamePlayerInfo
430430 bool FindWarehouseForJob (Job job, noRoadNode* goal) const ;
431431 // / Prüft, ob der Spieler besiegt wurde
432432 void TestDefeat ();
433- nobHQ* GetHQ () const ;
433+ const nobHQ* GetHQ () const ;
434434
435435 // ////////////////////////////////////////////////////////////////////////
436436 // / Unsynchronized state (e.g. lua, gui...)
You can’t perform that action at this time.
0 commit comments