~ubuntu-branches/ubuntu/lucid/warzone2100/lucid

« back to all changes in this revision

Viewing changes to src/aiexperience.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger, Paul Wise, Christoph Egger
  • Date: 2009-06-29 17:12:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090629171252-5ddnlfg3zfchrega
Tags: 2.2.1+dfsg1-1
[ Paul Wise ]
* New upstream release (Closes: #534962)
* Adjust the flex build-depends to take account of the conflict
  with all the versions of flex 2.5.34 (LP: #372872)
* Make the -music Recommends more strict, 2.1 music doesn't work
  with 2.2.
* Upstream moved the downloads to sourceforge, update the watch file
* Bump Standards-Version, no changes needed
* Drop use of dh_desktop since it no longer does anything
* Recommend the new warzone2100-video package, version 2.2 or similar
* Mention the warzone2100 crash reports in the -dbg package description

[ Christoph Egger ]
* Replace CC-2.0 graphic from cybersphinx, create a new tarball
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
        This file is part of Warzone 2100.
3
 
        Copyright (C) 1999-2004  Eidos Interactive
4
 
        Copyright (C) 2005-2007  Warzone Resurrection Project
 
3
        Copyright (C) 2006-2009  Warzone Resurrection Project
5
4
 
6
5
        Warzone 2100 is free software; you can redistribute it and/or modify
7
6
        it under the terms of the GNU General Public License as published by
17
16
        along with Warzone 2100; if not, write to the Free Software
18
17
        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
18
*/
20
 
//aiexperience.c
 
19
 
21
20
#include <physfs.h>
22
21
#include <string.h>
23
22
 
25
24
#include "objectdef.h"
26
25
#include "map.h"
27
26
#include "lib/framework/frame.h"
28
 
#include "lib/script/interp.h"
 
27
#include "lib/script/interpreter.h"
29
28
#include "lib/script/stack.h"
30
29
#include "lib/script/codeprint.h"
31
30
#include "lib/script/script.h"
220
219
 
221
220
        if (!aiSaveFile[nPlayer])
222
221
        {
223
 
                debug(LOG_ERROR,"SetUpInputFile(): Couldn't open input file: '%s' for player %d: %s", FileName, nPlayer, PHYSFS_getLastError());
 
222
                debug(LOG_ERROR,"SetUpInputFile(): Couldn't open input file: [directory: %s] '%s' for player %d: %s", PHYSFS_getRealDir(FileName), FileName, nPlayer, PHYSFS_getLastError());
224
223
                return false;
225
224
        }
226
225
 
815
814
                if((baseDefendLocation[nPlayer][i][0] > 0) && (baseDefendLocation[nPlayer][i][1] > 0))          //if this one initialized
816
815
                {
817
816
                        //check if very close to an already stored location
818
 
                        if(dirtySqrt(x,y,baseDefendLocation[nPlayer][i][0],baseDefendLocation[nPlayer][i][1]) < range)
 
817
                        if (hypotf(x - baseDefendLocation[nPlayer][i][0], y - baseDefendLocation[nPlayer][i][1]) < range)
819
818
                        {
820
819
                                return i;                                                               //end here
821
820
                        }
966
965
                if((oilDefendLocation[nPlayer][i][0] > 0) && (oilDefendLocation[nPlayer][i][1] > 0))            //if this one initialized
967
966
                {
968
967
                        //check if very close to an already stored location
969
 
                        if(dirtySqrt(x,y,oilDefendLocation[nPlayer][i][0],oilDefendLocation[nPlayer][i][1]) < range)
 
968
                        if (hypotf(x - oilDefendLocation[nPlayer][i][0], y - oilDefendLocation[nPlayer][i][1]) < range)
970
969
                        {
971
970
                                return i;                                                               //end here
972
971
                        }