~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/ai/ai.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Kooijman
  • Date: 2008-08-08 11:07:05 UTC
  • mfrom: (1.1.4 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080808110705-zq0eo95c4pexg70i
* New upstream release.
  - Fixes remote crash vulnerability CVE-2008-3547. Closes: #493714

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: ai.cpp 11871 2008-01-16 01:18:15Z smatz $ */
 
1
/* $Id: ai.cpp 13811 2008-07-23 21:51:25Z rubidium $ */
2
2
 
3
3
#include "../stdafx.h"
4
4
#include "../openttd.h"
10
10
#include "../player_base.h"
11
11
#include "ai.h"
12
12
#include "default/default.h"
 
13
#include "trolly/trolly.h"
13
14
#include "../signal_func.h"
14
15
 
15
16
AIStruct _ai;
223
224
{
224
225
        /* Called if this AI died */
225
226
        _ai_player[player].active = false;
 
227
 
 
228
        if (_players_ainew[player].pathfinder == NULL) return;
 
229
 
 
230
        AyStarMain_Free(_players_ainew[player].pathfinder);
 
231
        delete _players_ainew[player].pathfinder;
 
232
        _players_ainew[player].pathfinder = NULL;
 
233
 
226
234
}
227
235
 
228
236
/**
244
252
 */
245
253
void AI_Uninitialize()
246
254
{
247
 
        const Player* p;
248
 
 
249
 
        FOR_ALL_PLAYERS(p) {
250
 
                if (p->is_active && p->is_ai) AI_PlayerDied(p->index);
251
 
        }
 
255
        for (PlayerID p = PLAYER_FIRST; p < MAX_PLAYERS; p++) AI_PlayerDied(p);
252
256
}