Partially revert r739.
SDL < 1.2.10 doesn't define the string function wrappers. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@747 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
6fc01a0289
commit
912cf2c8e2
|
@ -68,7 +68,7 @@ static int code_part_from_str(const char *str)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < LOG_LAST; i++) {
|
||||
if (SDL_strcasecmp(code_part_names[i], str) == 0) {
|
||||
if (strcasecmp(code_part_names[i], str) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define vsnprintf _vsnprintf
|
||||
#define snprintf _snprintf
|
||||
|
||||
|
|
|
@ -342,8 +342,7 @@ anim_GetAnimID( char *szName )
|
|||
|
||||
/* find matching anim string in list */
|
||||
psAnim = g_animGlobals.psAnimList;
|
||||
while( psAnim != NULL &&
|
||||
SDL_strcasecmp( psAnim->szFileName, szName ) != 0 )
|
||||
while( psAnim != NULL && strcasecmp( psAnim->szFileName, szName ) != 0 )
|
||||
{
|
||||
psAnim = psAnim->psNext;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ void iV_FreeImageFile(IMAGEFILE *ImageFile)
|
|||
// for(i=0; i<ImageFile->Header.NumTPages; i++) {
|
||||
// FREE(ImageFile->TexturePages[i].bmp);
|
||||
// }
|
||||
|
||||
|
||||
FREE(ImageFile->TexturePages);
|
||||
FREE(ImageFile->ImageDefs);
|
||||
FREE(ImageFile);
|
||||
|
@ -170,7 +170,7 @@ static BOOL LoadTextureFile(STRING *FileName, iSprite *pSprite, int *texPageID)
|
|||
return FALSE;
|
||||
} else {
|
||||
*pSprite = *(iSprite*)resGetData("IMGPAGE", real_filename);
|
||||
debug(LOG_TEXTURE, "Load texture from resource cache: %s (%d, %d)",
|
||||
debug(LOG_TEXTURE, "Load texture from resource cache: %s (%d, %d)",
|
||||
real_filename, pSprite->width, pSprite->height);
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ static BOOL LoadTextureFile(STRING *FileName, iSprite *pSprite, int *texPageID)
|
|||
|
||||
/* We have already loaded this one? */
|
||||
while (i < _TEX_INDEX) {
|
||||
if (SDL_strcasecmp(real_filename, _TEX_PAGE[i].name) == 0) {
|
||||
if (strcasecmp(real_filename, _TEX_PAGE[i].name) == 0) {
|
||||
*texPageID = (_TEX_PAGE[i].textPage3dfx);
|
||||
debug(LOG_TEXTURE, "LoadTextureFile: already loaded");
|
||||
return TRUE;
|
||||
|
|
|
@ -276,7 +276,7 @@ iIMDShape *iV_ProcessIMD(STRING **ppFileData, STRING *FileDataEnd, STRING *IMDpa
|
|||
if (bTextured) {
|
||||
//resToLower(texfile);
|
||||
// printf("texfile cmp in imdload.c :%s\n", texfile);
|
||||
if (SDL_strncasecmp(texfile, "page-", 5) == 0) {
|
||||
if (strncasecmp(texfile, "page-", 5) == 0) {
|
||||
for(i = 5; i < (SDWORD)strlen(texfile); i++) {
|
||||
if (!isdigit(texfile[i])) {
|
||||
break;
|
||||
|
|
|
@ -65,7 +65,7 @@ int pie_AddBMPtoTexPages(iSprite* s, STRING* filename, int type, iBool bColourKe
|
|||
|
||||
/* Have we already loaded this one? (Should generally not happen here.) */
|
||||
while (i < _TEX_INDEX) {
|
||||
if (SDL_strcasecmp(filename, _TEX_PAGE[i].name) == 0) {
|
||||
if (strcasecmp(filename, _TEX_PAGE[i].name) == 0) {
|
||||
// this happens with terrain for some reason, which is necessary
|
||||
debug(LOG_TEXTURE, "pie_AddBMPtoTexPages: %s loaded again", filename);
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ int iV_GetTexture(char *filename)
|
|||
|
||||
/* Have we already loaded this one then? (Yes. Always.) */
|
||||
while (i < _TEX_INDEX) {
|
||||
if (SDL_strcasecmp(filename, _TEX_PAGE[i].name) == 0) {
|
||||
if (strcasecmp(filename, _TEX_PAGE[i].name) == 0) {
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
|
@ -182,7 +182,7 @@ int pie_ReloadTexPage(STRING *filename, char *pBuffer)
|
|||
debug( LOG_NEVER, "pie_ReloadTexPage called" );
|
||||
|
||||
/* Have we already loaded this one then? */
|
||||
while (SDL_strcasecmp(filename,_TEX_PAGE[i].name) != 0) {
|
||||
while (strcasecmp(filename,_TEX_PAGE[i].name) != 0) {
|
||||
i++;
|
||||
if (i >= _TEX_INDEX) {
|
||||
debug(LOG_TEXTURE, "Texture %s not in resources", filename);
|
||||
|
|
|
@ -281,7 +281,7 @@ static BOOL cdAudio_OpenTrack(char* filename) {
|
|||
music_file_format = WZ_NONE;
|
||||
|
||||
#ifndef WZ_NOMP3
|
||||
if (SDL_strncasecmp(filename+strlen(filename)-4, ".mp3", 4) == 0)
|
||||
if (strncasecmp(filename+strlen(filename)-4, ".mp3", 4) == 0)
|
||||
{
|
||||
music_file = PHYSFS_openRead(filename);
|
||||
|
||||
|
@ -323,7 +323,7 @@ static BOOL cdAudio_OpenTrack(char* filename) {
|
|||
#endif
|
||||
|
||||
#ifndef WZ_NOOGG
|
||||
if (SDL_strncasecmp(filename+strlen(filename)-4, ".ogg", 4) == 0)
|
||||
if (strncasecmp(filename+strlen(filename)-4, ".ogg", 4) == 0)
|
||||
{
|
||||
music_file = PHYSFS_openRead(filename);
|
||||
|
||||
|
|
|
@ -487,7 +487,7 @@ audioID_GetIDFromStr( const STRING *pWavStr, SDWORD *piID )
|
|||
|
||||
for ( i=0; i<ID_MAX_SOUND; i++ )
|
||||
{
|
||||
if ( SDL_strcasecmp( pWavStr, asAudioID[i].pWavStr ) == 0 )
|
||||
if ( strcasecmp( pWavStr, asAudioID[i].pWavStr ) == 0 )
|
||||
{
|
||||
ASSERT( i == asAudioID[i].iID,
|
||||
"audioID_GetIDFromStr: %s stored IDs don't match", pWavStr );
|
||||
|
|
|
@ -71,7 +71,7 @@ BOOL ParseCommandLineEarly(int argc, char** argv)
|
|||
for (i = 1; i < argc; ++i) {
|
||||
tokenType = argv[i];
|
||||
|
||||
if ( SDL_strcasecmp(tokenType, "--version") == 0 )
|
||||
if ( strcasecmp(tokenType, "--version") == 0 )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
fprintf( stdout, "Warzone 2100 - Version %s - Built %s - DEBUG\n", VERSION, __DATE__ );
|
||||
|
@ -80,7 +80,7 @@ BOOL ParseCommandLineEarly(int argc, char** argv)
|
|||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--help" ) == 0 )
|
||||
else if ( strcasecmp(tokenType, "--help" ) == 0 )
|
||||
{
|
||||
// Show help
|
||||
fprintf( stdout,
|
||||
|
@ -107,7 +107,7 @@ BOOL ParseCommandLineEarly(int argc, char** argv)
|
|||
);
|
||||
return FALSE;
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--datadir") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--datadir") == 0 )
|
||||
{
|
||||
// find the quoted path name
|
||||
token = argv[++i];
|
||||
|
@ -118,7 +118,7 @@ BOOL ParseCommandLineEarly(int argc, char** argv)
|
|||
}
|
||||
strncpy(datadir, token, sizeof(datadir));
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--debug") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--debug") == 0 )
|
||||
{
|
||||
// find the part name
|
||||
token = argv[++i];
|
||||
|
@ -131,7 +131,7 @@ BOOL ParseCommandLineEarly(int argc, char** argv)
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--debugfile") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--debugfile") == 0 )
|
||||
{
|
||||
// find the file name
|
||||
token = argv[++i];
|
||||
|
@ -166,16 +166,16 @@ BOOL ParseCommandLine(int argc, char** argv)
|
|||
for( i = 1; i < argc; ++i) {
|
||||
tokenType = argv[i];
|
||||
|
||||
if ( SDL_strcasecmp(tokenType, "--cheat") == 0 )
|
||||
if ( strcasecmp(tokenType, "--cheat") == 0 )
|
||||
{
|
||||
fprintf(stdout, " ** CHEAT MODE ACTIVATED! **\n");
|
||||
bAllowDebugMode = TRUE;
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--fullscreen" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--fullscreen" ) == 0 )
|
||||
{
|
||||
war_setFullscreen(TRUE);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--game" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--game" ) == 0 )
|
||||
{
|
||||
// find the game name
|
||||
token = argv[++i];
|
||||
|
@ -188,7 +188,7 @@ BOOL ParseCommandLine(int argc, char** argv)
|
|||
strncpy(pLevelName, token, 254);
|
||||
SetGameMode(GS_NORMAL);
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--mod") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--mod") == 0 )
|
||||
{
|
||||
// find the file name
|
||||
token = argv[++i];
|
||||
|
@ -202,7 +202,7 @@ BOOL ParseCommandLine(int argc, char** argv)
|
|||
debug( LOG_ERROR, "Too many mods registered! Aborting!" );
|
||||
global_mods[j] = token;
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--mod_ca") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--mod_ca") == 0 )
|
||||
{
|
||||
// find the file name
|
||||
token = argv[++i];
|
||||
|
@ -217,7 +217,7 @@ BOOL ParseCommandLine(int argc, char** argv)
|
|||
debug( LOG_ERROR, "Too many mods registered! Aborting!" );
|
||||
campaign_mods[j] = token;
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--mod_mp") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--mod_mp") == 0 )
|
||||
{
|
||||
// find the file name
|
||||
token = argv[++i];
|
||||
|
@ -232,7 +232,7 @@ BOOL ParseCommandLine(int argc, char** argv)
|
|||
debug( LOG_ERROR, "Too many mods registered! Aborting!" );
|
||||
multiplay_mods[j] = token;
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--savegame" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--savegame" ) == 0 )
|
||||
{
|
||||
// find the game name
|
||||
token = argv[++i];
|
||||
|
@ -247,28 +247,28 @@ BOOL ParseCommandLine(int argc, char** argv)
|
|||
strncat(saveGameName, token, 240);
|
||||
SetGameMode(GS_SAVEGAMELOAD);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--shadows" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--shadows" ) == 0 )
|
||||
{
|
||||
// FIXME Should setDrawShadows go into warzoneconfig? Or how should config values be handled in general? By the system using it? Or by warzoneconfig? Or by config keys only?
|
||||
//setDrawShadows( TRUE );
|
||||
setWarzoneKeyNumeric( "shadows", TRUE );
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--noshadows" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--noshadows" ) == 0 )
|
||||
{
|
||||
//setDrawShadows( FALSE );
|
||||
setWarzoneKeyNumeric( "shadows", FALSE );
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--sound" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--sound" ) == 0 )
|
||||
{
|
||||
war_setSoundEnabled( TRUE );
|
||||
setWarzoneKeyNumeric( "sound", TRUE );
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--nosound" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--nosound" ) == 0 )
|
||||
{
|
||||
war_setSoundEnabled( FALSE );
|
||||
setWarzoneKeyNumeric( "sound", FALSE );
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--viewport" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--viewport" ) == 0 )
|
||||
{
|
||||
token = argv[++i];
|
||||
if ( !sscanf( token, "%ix%i", &width, &height ) == 2 )
|
||||
|
@ -279,62 +279,62 @@ BOOL ParseCommandLine(int argc, char** argv)
|
|||
}
|
||||
pie_SetVideoBuffer( width, height );
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--window" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--window" ) == 0 )
|
||||
{
|
||||
war_setFullscreen(FALSE);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--intro" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--intro" ) == 0 )
|
||||
{
|
||||
SetGameMode(GS_VIDEO_MODE);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType, "--title" ) == 0 )
|
||||
else if ( strcasecmp( tokenType, "--title" ) == 0 )
|
||||
{
|
||||
SetGameMode(GS_TITLE_SCREEN);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType,"--noTranslucent") == 0 )
|
||||
else if ( strcasecmp( tokenType,"--noTranslucent") == 0 )
|
||||
{
|
||||
war_SetTranslucent(FALSE);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType,"--noAdditive") == 0)
|
||||
else if ( strcasecmp( tokenType,"--noAdditive") == 0)
|
||||
{
|
||||
war_SetAdditive(FALSE);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType,"--noFog") == 0 )
|
||||
else if ( strcasecmp( tokenType,"--noFog") == 0 )
|
||||
{
|
||||
pie_SetFogCap(FOG_CAP_NO);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType,"--greyFog") == 0 )
|
||||
else if ( strcasecmp( tokenType,"--greyFog") == 0 )
|
||||
{
|
||||
pie_SetFogCap(FOG_CAP_GREY);
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--CDA") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--CDA") == 0 )
|
||||
{
|
||||
war_SetPlayAudioCDs(TRUE);
|
||||
}
|
||||
else if ( SDL_strcasecmp(tokenType, "--noCDA") == 0 )
|
||||
else if ( strcasecmp(tokenType, "--noCDA") == 0 )
|
||||
{
|
||||
war_SetPlayAudioCDs(FALSE);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType,"--seqSmall") == 0 )
|
||||
else if ( strcasecmp( tokenType,"--seqSmall") == 0 )
|
||||
{
|
||||
war_SetSeqMode(SEQ_SMALL);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType,"--seqSkip") == 0 )
|
||||
else if ( strcasecmp( tokenType,"--seqSkip") == 0 )
|
||||
{
|
||||
war_SetSeqMode(SEQ_SKIP);
|
||||
}
|
||||
else if ( SDL_strcasecmp( tokenType,"--disableLobby") == 0 )
|
||||
else if ( strcasecmp( tokenType,"--disableLobby") == 0 )
|
||||
{
|
||||
bDisableLobby = TRUE;
|
||||
}
|
||||
|
||||
// gamespy flags
|
||||
else if ( SDL_strcasecmp(tokenType, "+host") == 0 // host a multiplayer.
|
||||
|| SDL_strcasecmp(tokenType, "+connect") == 0
|
||||
|| SDL_strcasecmp(tokenType, "+name") == 0
|
||||
|| SDL_strcasecmp(tokenType, "+ip") == 0
|
||||
|| SDL_strcasecmp(tokenType, "+maxplayers") == 0
|
||||
|| SDL_strcasecmp(tokenType, "+hostname") == 0)
|
||||
else if ( strcasecmp(tokenType, "+host") == 0 // host a multiplayer.
|
||||
|| strcasecmp(tokenType, "+connect") == 0
|
||||
|| strcasecmp(tokenType, "+name") == 0
|
||||
|| strcasecmp(tokenType, "+ip") == 0
|
||||
|| strcasecmp(tokenType, "+maxplayers") == 0
|
||||
|| strcasecmp(tokenType, "+hostname") == 0)
|
||||
{
|
||||
token = argv[++i];
|
||||
scanGameSpyFlags(tokenType, token);
|
||||
|
@ -381,7 +381,7 @@ BOOL scanGameSpyFlags(LPSTR gflag,LPSTR value)
|
|||
gameSpy.bGameSpy = TRUE;
|
||||
}
|
||||
|
||||
if( SDL_strcasecmp( gflag,"+host") == 0) // host a multiplayer.
|
||||
if (strcasecmp( gflag,"+host") == 0) // host a multiplayer.
|
||||
{
|
||||
NetPlay.bHost = 1;
|
||||
game.bytesPerSec = INETBYTESPERSEC;
|
||||
|
@ -389,7 +389,7 @@ BOOL scanGameSpyFlags(LPSTR gflag,LPSTR value)
|
|||
NETsetupTCPIP(&finalconnection,"");
|
||||
NETselectProtocol(finalconnection);
|
||||
}
|
||||
else if( SDL_strcasecmp( gflag,"+connect") == 0) // join a multiplayer.
|
||||
else if (strcasecmp( gflag,"+connect") == 0) // join a multiplayer.
|
||||
{
|
||||
NetPlay.bHost = 0;
|
||||
game.bytesPerSec = INETBYTESPERSEC;
|
||||
|
@ -398,11 +398,11 @@ BOOL scanGameSpyFlags(LPSTR gflag,LPSTR value)
|
|||
NETselectProtocol(finalconnection);
|
||||
// gflag is add to con to.
|
||||
}
|
||||
else if( SDL_strcasecmp( gflag,"+name") == 0) // player name.
|
||||
else if (strcasecmp( gflag,"+name") == 0) // player name.
|
||||
{
|
||||
strcpy((char *)sPlayer,value);
|
||||
}
|
||||
else if( SDL_strcasecmp( gflag,"+hostname") == 0) // game name.
|
||||
else if (strcasecmp( gflag,"+hostname") == 0) // game name.
|
||||
{
|
||||
strcpy(game.name,value);
|
||||
}
|
||||
|
|
|
@ -955,7 +955,7 @@ BOOL buildMapList(void)
|
|||
for ( file = filelist; *file != NULL; ++file ) {
|
||||
len = strlen( *file );
|
||||
if ( len > 10 // Do not add addon.lev again
|
||||
&& !SDL_strcasecmp( *file+(len-10), ".addon.lev") ) {
|
||||
&& !strcasecmp( *file+(len-10), ".addon.lev") ) {
|
||||
debug( LOG_WZ, "Loading lev file: %s\n", *file );
|
||||
loadLevFile( *file, MOD_MULTIPLAY );
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ BOOL systemInitialise(void)
|
|||
}
|
||||
|
||||
if ( war_getSoundEnabled() )
|
||||
{
|
||||
{
|
||||
if( !audio_Init(droidAudioTrackStopped) )
|
||||
debug( LOG_SOUND, "Couldn't initialise audio system: continuing without audio\n" );
|
||||
}
|
||||
|
|
|
@ -2801,7 +2801,7 @@ RESEARCH * getResearch(STRING *pName, BOOL resName)
|
|||
#ifdef HASH_NAMES
|
||||
if (asResearch[inc].NameHash==HashedName)
|
||||
#else
|
||||
if (!SDL_strcasecmp(asResearch[inc].pName, pName))
|
||||
if (!strcasecmp(asResearch[inc].pName, pName))
|
||||
#endif
|
||||
{
|
||||
return &asResearch[inc];
|
||||
|
|
|
@ -9535,7 +9535,7 @@ BOOL addHelpBlip(SDWORD locX, SDWORD locY, SDWORD forPlayer, SDWORD sender, STRI
|
|||
psMessage->pViewData = (MSG_VIEWDATA *)pTempData;
|
||||
|
||||
//check the z value is at least the height of the terrain
|
||||
height = map_Height(((VIEW_PROXIMITY *)pTempData->pData)->x,
|
||||
height = map_Height(((VIEW_PROXIMITY *)pTempData->pData)->x,
|
||||
((VIEW_PROXIMITY *)pTempData->pData)->y);
|
||||
|
||||
//if (((VIEW_PROXIMITY *)pTempData->pData)->z < height)
|
||||
|
@ -9561,7 +9561,7 @@ BOOL addHelpBlip(SDWORD locX, SDWORD locY, SDWORD forPlayer, SDWORD sender, STRI
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -9613,7 +9613,7 @@ VIEWDATA *HelpViewData(SDWORD sender, STRING *textMsg, UDWORD LocX, UDWORD LocY)
|
|||
{
|
||||
debug(LOG_ERROR,"prepairHelpViewData() - ViewData Name - Out of memory");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
strcpy(psViewData->pName,name);
|
||||
|
||||
|
@ -9634,7 +9634,7 @@ VIEWDATA *HelpViewData(SDWORD sender, STRING *textMsg, UDWORD LocX, UDWORD LocY)
|
|||
debug(LOG_ERROR,"prepairHelpViewData() - Unable to allocate memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//store audio
|
||||
audioID = NO_SOUND;
|
||||
|
@ -9646,7 +9646,7 @@ VIEWDATA *HelpViewData(SDWORD sender, STRING *textMsg, UDWORD LocX, UDWORD LocY)
|
|||
debug(LOG_ERROR,"prepairHelpViewData() - Negative X coord for prox message");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (LocY < 0)
|
||||
{
|
||||
debug(LOG_ERROR,"prepairHelpViewData() - Negative X coord for prox message");
|
||||
|
@ -9752,7 +9752,7 @@ BOOL scrRemoveHelpMessage(void)
|
|||
}
|
||||
//else
|
||||
//{
|
||||
// ASSERT((FALSE, "scrRemoveMessage:cannot find message - %s",
|
||||
// ASSERT((FALSE, "scrRemoveMessage:cannot find message - %s",
|
||||
// psViewData->pName));
|
||||
// return FALSE;
|
||||
//}
|
||||
|
@ -9825,7 +9825,7 @@ SDWORD getNumRepairedBy(DROID *psDroidToCheck, SDWORD player)
|
|||
BOOL scrMsgBox(void)
|
||||
{
|
||||
STRING *ssval=NULL;
|
||||
|
||||
|
||||
if (!stackPopParams(1, VAL_STRING, &ssval))
|
||||
{
|
||||
debug(LOG_ERROR, "scrMsgBox(): stack failed");
|
||||
|
@ -9835,7 +9835,7 @@ BOOL scrMsgBox(void)
|
|||
//dbg_console("DEBUG: %s", ssval);
|
||||
|
||||
printf_console("DEBUG: %s",ssval);
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -9871,7 +9871,7 @@ BOOL scrStructInRangeVis(void)
|
|||
// check for a base object being in range of a point
|
||||
BOOL objectInRangeVis(BASE_OBJECT *psList, SDWORD x, SDWORD y, SDWORD range, SDWORD lookingPlayer)
|
||||
{
|
||||
BASE_OBJECT *psCurr;
|
||||
BASE_OBJECT *psCurr;
|
||||
SDWORD xdiff, ydiff, rangeSq;
|
||||
|
||||
// See if there is a droid in range
|
||||
|
@ -9932,7 +9932,7 @@ BOOL scrPursueResearch(void)
|
|||
STRING sTemp[128];
|
||||
STRUCTURE *psBuilding;
|
||||
RESEARCH_FACILITY *psResFacilty;
|
||||
|
||||
|
||||
RESEARCH *pResearch;
|
||||
|
||||
if (!stackPopParams(3,ST_STRUCTURE, &structure, VAL_INT, &player, ST_RESEARCH, &psResearch ))
|
||||
|
@ -9942,7 +9942,7 @@ BOOL scrPursueResearch(void)
|
|||
}
|
||||
|
||||
if(psResearch == NULL)
|
||||
{
|
||||
{
|
||||
ASSERT(FALSE, ": no such research topic");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -10020,14 +10020,14 @@ BOOL scrPursueResearch(void)
|
|||
}
|
||||
index = Stack[top + 2]; //if index = -1, then exit
|
||||
cur = Stack[top + 1]; //go to next PR of the last node, since this one didn't work
|
||||
|
||||
|
||||
}
|
||||
else //end of nodes not reached
|
||||
{
|
||||
tempIndex = asResearch[index].pPRList[cur]; //get cur node's index
|
||||
//DbgMsg("evaluating node: %d, (cur = %d), %s", tempIndex, cur, asResearch[tempIndex].pName);
|
||||
|
||||
if(skTopicAvail(tempIndex,player) && (!beingResearchedByAlly(tempIndex, player))) //<NEW> - ally check added
|
||||
if(skTopicAvail(tempIndex,player) && (!beingResearchedByAlly(tempIndex, player))) //<NEW> - ally check added
|
||||
{
|
||||
//DbgMsg("avail: %d (cur=%d), %s", tempIndex, cur, asResearch[tempIndex].pName);
|
||||
found = TRUE;
|
||||
|
@ -10078,9 +10078,9 @@ BOOL scrPursueResearch(void)
|
|||
pResearch = (asResearch + foundIndex);
|
||||
pPlayerRes = asPlayerResList[player]+ foundIndex;
|
||||
psResFacilty->psSubject = (BASE_STATS*)pResearch; //set the subject up
|
||||
|
||||
|
||||
if (IsResearchCancelled(pPlayerRes))
|
||||
{
|
||||
{
|
||||
psResFacilty->powerAccrued = pResearch->researchPower;//set up as if all power available for cancelled topics
|
||||
}
|
||||
else
|
||||
|
@ -10176,7 +10176,7 @@ SDWORD guessPlayerFromMessage(STRING **str)
|
|||
|
||||
while( sscanf(*str, "%[^,:;?! ]%*[,;?! ]%n", playerName, &count) //didn't reach the end //first field: what to stop on; second field: what to read (skip) afterwards
|
||||
&& player >= 0 //last string was a player name
|
||||
//&& *str < copyStr + strlen(copyStr)
|
||||
//&& *str < copyStr + strlen(copyStr)
|
||||
)
|
||||
{
|
||||
if(count==0) /* nothing read ? */
|
||||
|
@ -10218,7 +10218,7 @@ SDWORD getPlayerFromString(STRING *playerName)
|
|||
{
|
||||
/* check name */
|
||||
debug(LOG_SCRIPT, "checking (%s,%s)",getPlayerName(playerIndex), playerName);
|
||||
if(SDL_strncasecmp(getPlayerName(playerIndex),playerName, 255) == 0)
|
||||
if (strncasecmp(getPlayerName(playerIndex),playerName, 255) == 0)
|
||||
{
|
||||
debug(LOG_SCRIPT, "matched, returning %d", playerIndex);
|
||||
return playerIndex;
|
||||
|
@ -10226,7 +10226,7 @@ SDWORD getPlayerFromString(STRING *playerName)
|
|||
|
||||
/* check color */
|
||||
debug(LOG_SCRIPT, "checking (%s,%s)",getPlayerColorName(playerIndex), playerName);
|
||||
if(SDL_strncasecmp(getPlayerColorName(playerIndex),playerName, 255) == 0)
|
||||
if (strncasecmp(getPlayerColorName(playerIndex),playerName, 255) == 0)
|
||||
{
|
||||
debug(LOG_SCRIPT, "matched, returning %d", playerIndex);
|
||||
return playerIndex;
|
||||
|
@ -10235,12 +10235,12 @@ SDWORD getPlayerFromString(STRING *playerName)
|
|||
/* check player number */
|
||||
sprintf(sPlayerNumber,"%d",playerIndex);
|
||||
debug(LOG_SCRIPT, "checking (%s,%s)",sPlayerNumber, playerName);
|
||||
if(SDL_strncasecmp(sPlayerNumber,playerName, 255) == 0)
|
||||
if (strncasecmp(sPlayerNumber,playerName, 255) == 0)
|
||||
{
|
||||
debug(LOG_SCRIPT, "matched, returning %d", playerIndex);
|
||||
return playerIndex;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
@ -10279,7 +10279,7 @@ BOOL scrGetTargetPlayers(void)
|
|||
strcpy(*ssval, myMsg);
|
||||
|
||||
debug(LOG_SCRIPT, "scrGetTargetPlayers: ssval='%s'", *ssval);
|
||||
|
||||
|
||||
if (!stackPushResult(VAL_INT, players))
|
||||
{
|
||||
debug(LOG_ERROR, "scrGetTargetPlayers(): failed to push result");
|
||||
|
@ -10346,7 +10346,7 @@ BOOL scrMatch(void)
|
|||
debug(LOG_SCRIPT, "wordNeed '%s'", wordNeed);
|
||||
|
||||
/* failed if *one* of the strings ended */
|
||||
if((fieldAssignedParse > 0 && fieldAssignedMatch <= 0)
|
||||
if((fieldAssignedParse > 0 && fieldAssignedMatch <= 0)
|
||||
|| (fieldAssignedMatch > 0 && fieldAssignedParse <= 0))
|
||||
{
|
||||
debug(LOG_SCRIPT, "exit condition FAILED");
|
||||
|
@ -10361,14 +10361,14 @@ BOOL scrMatch(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* now compare both words
|
||||
* now compare both words
|
||||
*/
|
||||
|
||||
if(SDL_strncasecmp(wordNeed,"<player>", 255) == 0) /* if we are looking for player */
|
||||
|
||||
if (strncasecmp(wordNeed,"<player>", 255) == 0) /* if we are looking for player */
|
||||
{
|
||||
debug(LOG_SCRIPT, "matching <player>");
|
||||
*nResult = getPlayerFromString(wordFound);
|
||||
|
||||
|
||||
if(*nResult == -1) /* failed to match player, stop */
|
||||
{
|
||||
debug(LOG_SCRIPT, "failed to match <player>");
|
||||
|
@ -10379,7 +10379,7 @@ BOOL scrMatch(void)
|
|||
debug(LOG_SCRIPT, "matched <player>");
|
||||
}
|
||||
}
|
||||
else if(SDL_strncasecmp(wordNeed,wordFound,255) != 0) /* just compare words to se if they match */
|
||||
else if (strncasecmp(wordNeed,wordFound,255) != 0) /* just compare words to se if they match */
|
||||
{
|
||||
debug(LOG_SCRIPT, "words did not match");
|
||||
ok = FALSE;
|
||||
|
@ -10392,7 +10392,7 @@ BOOL scrMatch(void)
|
|||
|
||||
FREE(wordFound);
|
||||
FREE(wordNeed);
|
||||
|
||||
|
||||
if (!stackPushResult(VAL_BOOL, ok))
|
||||
{
|
||||
debug(LOG_ERROR, "scrGetTargetPlayers(): failed to push result");
|
||||
|
@ -10418,5 +10418,5 @@ SDWORD getFirstWord(STRING *sText, STRING **sWord, SDWORD *readCount)
|
|||
|
||||
*readCount = count;
|
||||
|
||||
return fieldsAssigned;
|
||||
return fieldsAssigned;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue