mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r16556) -Codechange [NoAI]: use accessor for AIInstance::is_dead
This commit is contained in:
parent
35635c6248
commit
83e2df5b72
@ -272,7 +272,7 @@ void AIInstance::Died()
|
|||||||
|
|
||||||
void AIInstance::GameLoop()
|
void AIInstance::GameLoop()
|
||||||
{
|
{
|
||||||
if (this->is_dead) return;
|
if (this->IsDead()) return;
|
||||||
if (this->engine->HasScriptCrashed()) {
|
if (this->engine->HasScriptCrashed()) {
|
||||||
/* The script crashed during saving, kill it here. */
|
/* The script crashed during saving, kill it here. */
|
||||||
this->Died();
|
this->Died();
|
||||||
@ -338,7 +338,7 @@ void AIInstance::GameLoop()
|
|||||||
|
|
||||||
void AIInstance::CollectGarbage()
|
void AIInstance::CollectGarbage()
|
||||||
{
|
{
|
||||||
if (this->is_started && !this->is_dead) this->engine->CollectGarbage();
|
if (this->is_started && !this->IsDead()) this->engine->CollectGarbage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void AIInstance::DoCommandReturn(AIInstance *instance)
|
/* static */ void AIInstance::DoCommandReturn(AIInstance *instance)
|
||||||
|
@ -80,6 +80,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
class AIController *GetController() { return controller; }
|
class AIController *GetController() { return controller; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the "this AI died" value
|
||||||
|
*/
|
||||||
|
inline bool IsDead() { return this->is_dead; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call the AI Save function and save all data in the savegame.
|
* Call the AI Save function and save all data in the savegame.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user