* Remove whitespace from the end of lines
* Add a FIXME note about needing to control the calling frequency of handleAbandonedStructures externally * Moved variable reductionAmount into the most local scope * Rename iterator `i` to `player` git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4406 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
29578ca90f
commit
931f87f70a
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
typedef struct _bridge_info
|
typedef struct _bridge_info
|
||||||
{
|
{
|
||||||
UDWORD startX,startY,endX,endY; // Copy of coordinates of bridge.
|
UDWORD startX,startY,endX,endY; // Copy of coordinates of bridge.
|
||||||
UDWORD heightChange; // How much to raise lowest end by.
|
UDWORD heightChange; // How much to raise lowest end by.
|
||||||
UDWORD bridgeHeight; // How high are the sections?
|
UDWORD bridgeHeight; // How high are the sections?
|
||||||
UDWORD bridgeLength; // How many tiles long?
|
UDWORD bridgeLength; // How many tiles long?
|
||||||
|
|
|
@ -52,7 +52,7 @@ extern void combFire(WEAPON *psWeap, BASE_OBJECT *psAttacker, BASE_OBJECT *psTar
|
||||||
if any support a counter battery sensor*/
|
if any support a counter battery sensor*/
|
||||||
extern void counterBatteryFire(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget);
|
extern void counterBatteryFire(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget);
|
||||||
|
|
||||||
extern float objDamage(BASE_OBJECT *psObj, UDWORD damage, UDWORD originalhp, UDWORD weaponClass,
|
extern float objDamage(BASE_OBJECT *psObj, UDWORD damage, UDWORD originalhp, UDWORD weaponClass,
|
||||||
UDWORD weaponSubClass, HIT_SIDE impactSide);
|
UDWORD weaponSubClass, HIT_SIDE impactSide);
|
||||||
|
|
||||||
#endif // __INCLUDED_SRC_COMBAT_H__
|
#endif // __INCLUDED_SRC_COMBAT_H__
|
||||||
|
|
|
@ -294,7 +294,7 @@ static BOOL _addConsoleMessage(const char *messageText, CONSOLE_TEXT_JUSTIFICATI
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Wrapper for _addConsoleMessage
|
/// Wrapper for _addConsoleMessage
|
||||||
BOOL addConsoleMessage(const char *messageText, CONSOLE_TEXT_JUSTIFICATION jusType,
|
BOOL addConsoleMessage(const char *messageText, CONSOLE_TEXT_JUSTIFICATION jusType,
|
||||||
CONSOLE_TEXT_TYPE textType)
|
CONSOLE_TEXT_TYPE textType)
|
||||||
{
|
{
|
||||||
return _addConsoleMessage(messageText, jusType, textType);
|
return _addConsoleMessage(messageText, jusType, textType);
|
||||||
|
|
|
@ -1037,7 +1037,7 @@ FPATH_RETVAL fpathRoute(BASE_OBJECT *psObj, MOVE_CONTROL *psMoveCntl,
|
||||||
// Does this code work? - Per
|
// Does this code work? - Per
|
||||||
targetX = clearX;
|
targetX = clearX;
|
||||||
targetY = clearY;
|
targetY = clearY;
|
||||||
objTrace(LOG_MOVEMENT, psObj->id, "Unit %d: end point is blocked, going to (%d, %d) instead",
|
objTrace(LOG_MOVEMENT, psObj->id, "Unit %d: end point is blocked, going to (%d, %d) instead",
|
||||||
(int)psObj->id, (int)clearX, (int)clearY);
|
(int)psObj->id, (int)clearX, (int)clearY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1046,7 +1046,7 @@ FPATH_RETVAL fpathRoute(BASE_OBJECT *psObj, MOVE_CONTROL *psMoveCntl,
|
||||||
{
|
{
|
||||||
if (psPartialRouteObj != NULL)
|
if (psPartialRouteObj != NULL)
|
||||||
{
|
{
|
||||||
objTrace(LOG_MOVEMENT, psObj->id, "fpathRoute droid %d: found existing route during multi-frame path",
|
objTrace(LOG_MOVEMENT, psObj->id, "fpathRoute droid %d: found existing route during multi-frame path",
|
||||||
(int)psObj->id);
|
(int)psObj->id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -64,7 +64,7 @@ extern void fpathSetBlockingTile( UBYTE ubPropulsionType );
|
||||||
extern void fpathSetCurrentObject( BASE_OBJECT *psDroid );
|
extern void fpathSetCurrentObject( BASE_OBJECT *psDroid );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set direct path to position. Plan a path from psObj's current position to given position
|
* Set direct path to position. Plan a path from psObj's current position to given position
|
||||||
* without taking obstructions into consideration. Used for instance by VTOLs.
|
* without taking obstructions into consideration. Used for instance by VTOLs.
|
||||||
*/
|
*/
|
||||||
extern void fpathSetDirectRoute(BASE_OBJECT *psObj, SDWORD targetX, SDWORD targetY);
|
extern void fpathSetDirectRoute(BASE_OBJECT *psObj, SDWORD targetX, SDWORD targetY);
|
||||||
|
|
|
@ -241,7 +241,7 @@
|
||||||
/* maximum array sizes */
|
/* maximum array sizes */
|
||||||
#define MAXSTRUCTURES 200 //bumped up from 80. NOTE: was used for max # in build menus.
|
#define MAXSTRUCTURES 200 //bumped up from 80. NOTE: was used for max # in build menus.
|
||||||
#define MAXRESEARCH 200 //was 80 topic displayed " "
|
#define MAXRESEARCH 200 //was 80 topic displayed " "
|
||||||
#define MAXTEMPLATES 80 //was 20
|
#define MAXTEMPLATES 80 //was 20
|
||||||
#define MAXFEATURES 80
|
#define MAXFEATURES 80
|
||||||
#define MAXCOMPONENT 80
|
#define MAXCOMPONENT 80
|
||||||
#define MAXEXTRASYS 80
|
#define MAXEXTRASYS 80
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#ifndef __INCLUDED_SRC_INGAMEOP_H__
|
#ifndef __INCLUDED_SRC_INGAMEOP_H__
|
||||||
#define __INCLUDED_SRC_INGAMEOP_H__
|
#define __INCLUDED_SRC_INGAMEOP_H__
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
extern BOOL intAddInGameOptions (void);
|
extern BOOL intAddInGameOptions (void);
|
||||||
extern BOOL intCloseInGameOptions (BOOL bPutUpLoadSave, BOOL bResetMissionWidgets);
|
extern BOOL intCloseInGameOptions (BOOL bPutUpLoadSave, BOOL bResetMissionWidgets);
|
||||||
extern void intCloseInGameOptionsNoAnim (BOOL bResetMissionWidgets);
|
extern void intCloseInGameOptionsNoAnim (BOOL bResetMissionWidgets);
|
||||||
|
@ -49,7 +49,7 @@ extern BOOL InGameOpUp;
|
||||||
// game options
|
// game options
|
||||||
|
|
||||||
// initial options
|
// initial options
|
||||||
#define INTINGAMEOP_W 120
|
#define INTINGAMEOP_W 120
|
||||||
#define INTINGAMEOP_H 124
|
#define INTINGAMEOP_H 124
|
||||||
#define INTINGAMEOP_HS 88
|
#define INTINGAMEOP_HS 88
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,7 @@ void kf_ToggleSamples(void) //Displays number of sound sample in the sound queue
|
||||||
/* Writes out the frame rate */
|
/* Writes out the frame rate */
|
||||||
void kf_FrameRate( void )
|
void kf_FrameRate( void )
|
||||||
{
|
{
|
||||||
CONPRINTF(ConsoleString,(ConsoleString, _("FPS %d; FPS-Limit: %d; PIEs %d; polys %d; Terr. polys %d; States %d"),
|
CONPRINTF(ConsoleString,(ConsoleString, _("FPS %d; FPS-Limit: %d; PIEs %d; polys %d; Terr. polys %d; States %d"),
|
||||||
frameGetAverageRate(), getFramerateLimit(), loopPieCount, loopPolyCount, loopTileCount, loopStateChanges));
|
frameGetAverageRate(), getFramerateLimit(), loopPieCount, loopPolyCount, loopTileCount, loopStateChanges));
|
||||||
if (runningMultiplayer()) {
|
if (runningMultiplayer()) {
|
||||||
CONPRINTF(ConsoleString,(ConsoleString,
|
CONPRINTF(ConsoleString,(ConsoleString,
|
||||||
|
@ -2260,13 +2260,13 @@ float available_speed[] = {
|
||||||
// Since some of these values can ruin a SP game, we disallow them in normal mode.
|
// Since some of these values can ruin a SP game, we disallow them in normal mode.
|
||||||
1.f / 8.f, // n
|
1.f / 8.f, // n
|
||||||
1.f / 5.f, // n
|
1.f / 5.f, // n
|
||||||
1.f / 3.f, // p
|
1.f / 3.f, // p
|
||||||
3.f / 4.f, // p
|
3.f / 4.f, // p
|
||||||
1.f / 1.f, // p
|
1.f / 1.f, // p
|
||||||
5.f / 4.f, // p
|
5.f / 4.f, // p
|
||||||
3.f / 2.f, // p
|
3.f / 2.f, // p
|
||||||
2.f / 1.f, // p (in debug mode only)
|
2.f / 1.f, // p (in debug mode only)
|
||||||
5.f / 2.f, // n
|
5.f / 2.f, // n
|
||||||
3.f / 1.f, // n
|
3.f / 1.f, // n
|
||||||
10.f / 1.f, // n
|
10.f / 1.f, // n
|
||||||
20.f / 1.f // n
|
20.f / 1.f // n
|
||||||
|
@ -2296,7 +2296,7 @@ void kf_SpeedUp( void )
|
||||||
mod = available_speed[i];
|
mod = available_speed[i];
|
||||||
// only in debug/cheat mode do we enable all time compression speeds.
|
// only in debug/cheat mode do we enable all time compression speeds.
|
||||||
if (!getDebugMappingStatus())
|
if (!getDebugMappingStatus())
|
||||||
{
|
{
|
||||||
if (mod >= 2.f / 1.f) // max officialy allowed time compression
|
if (mod >= 2.f / 1.f) // max officialy allowed time compression
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2337,7 +2337,7 @@ void kf_SlowDown( void )
|
||||||
mod = available_speed[i];
|
mod = available_speed[i];
|
||||||
// only in debug/cheat mode do we enable all time compression speeds.
|
// only in debug/cheat mode do we enable all time compression speeds.
|
||||||
if( !getDebugMappingStatus() )
|
if( !getDebugMappingStatus() )
|
||||||
{
|
{
|
||||||
if (mod < 1.f / 3.f)
|
if (mod < 1.f / 3.f)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ char *pName;
|
||||||
struct _keyMapping *psNext;
|
struct _keyMapping *psNext;
|
||||||
} KEY_MAPPING;
|
} KEY_MAPPING;
|
||||||
|
|
||||||
extern KEY_MAPPING *keyAddMapping ( KEY_STATUS status, KEY_CODE metaCode, KEY_CODE subcode,
|
extern KEY_MAPPING *keyAddMapping ( KEY_STATUS status, KEY_CODE metaCode, KEY_CODE subcode,
|
||||||
KEY_ACTION action, void (*pKeyMapFunc)(void), const char *name );
|
KEY_ACTION action, void (*pKeyMapFunc)(void), const char *name );
|
||||||
extern BOOL keyRemoveMapping ( KEY_CODE metaCode, KEY_CODE subCode );
|
extern BOOL keyRemoveMapping ( KEY_CODE metaCode, KEY_CODE subCode );
|
||||||
extern KEY_MAPPING *keyGetMappingFromFunction(void *function);
|
extern KEY_MAPPING *keyGetMappingFromFunction(void *function);
|
||||||
|
@ -80,8 +80,8 @@ extern void keySetMappingStatus ( KEY_MAPPING *psMapping, BOOL state );
|
||||||
extern void processDebugMappings ( BOOL val );
|
extern void processDebugMappings ( BOOL val );
|
||||||
extern BOOL getDebugMappingStatus ( void );
|
extern BOOL getDebugMappingStatus ( void );
|
||||||
extern BOOL keyReAssignMappingName(char *pName, KEY_CODE newMetaCode, KEY_CODE newSubCode);
|
extern BOOL keyReAssignMappingName(char *pName, KEY_CODE newMetaCode, KEY_CODE newSubCode);
|
||||||
|
|
||||||
extern BOOL keyReAssignMapping( KEY_CODE origMetaCode, KEY_CODE origSubCode,
|
extern BOOL keyReAssignMapping( KEY_CODE origMetaCode, KEY_CODE origSubCode,
|
||||||
KEY_CODE newMetaCode, KEY_CODE newSubCode );
|
KEY_CODE newMetaCode, KEY_CODE newSubCode );
|
||||||
extern KEY_MAPPING *getKeyMapFromName(char *pName);
|
extern KEY_MAPPING *getKeyMapFromName(char *pName);
|
||||||
|
|
||||||
|
|
|
@ -1931,7 +1931,7 @@ SDWORD moveCalcDroidSpeed(DROID *psDroid)
|
||||||
speed = (MAX_SPEED_PITCH - pitch) * speed / MAX_SPEED_PITCH;
|
speed = (MAX_SPEED_PITCH - pitch) * speed / MAX_SPEED_PITCH;
|
||||||
if (speed <= 0)
|
if (speed <= 0)
|
||||||
{
|
{
|
||||||
// Very nasty hack to deal with buggy maps, where some cliffs are
|
// Very nasty hack to deal with buggy maps, where some cliffs are
|
||||||
// not properly marked as being cliffs, but too steep to drive over.
|
// not properly marked as being cliffs, but too steep to drive over.
|
||||||
// This confuses the heck out of the path-finding code! - Per
|
// This confuses the heck out of the path-finding code! - Per
|
||||||
speed = 10;
|
speed = 10;
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern BOOL objInitialise(void);
|
||||||
/* Shutdown the object system */
|
/* Shutdown the object system */
|
||||||
extern BOOL objShutdown(void);
|
extern BOOL objShutdown(void);
|
||||||
|
|
||||||
/*goes thru' the list passed in reversing the order so the first entry becomes
|
/*goes thru' the list passed in reversing the order so the first entry becomes
|
||||||
the last and the last entry becomes the first!*/
|
the last and the last entry becomes the first!*/
|
||||||
extern void reverseObjectList(BASE_OBJECT **ppsList);
|
extern void reverseObjectList(BASE_OBJECT **ppsList);
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ void killStruct(STRUCTURE *psDel);
|
||||||
extern void freeAllStructs(void);
|
extern void freeAllStructs(void);
|
||||||
|
|
||||||
/*Remove a single Structure from a list*/
|
/*Remove a single Structure from a list*/
|
||||||
extern void removeStructureFromList(STRUCTURE *psStructToRemove,
|
extern void removeStructureFromList(STRUCTURE *psStructToRemove,
|
||||||
STRUCTURE *pList[MAX_PLAYERS]);
|
STRUCTURE *pList[MAX_PLAYERS]);
|
||||||
|
|
||||||
/* Create a new Feature */
|
/* Create a new Feature */
|
||||||
|
|
|
@ -236,7 +236,7 @@ extern const char* getDroidOrderName(DROID_ORDER order);
|
||||||
|
|
||||||
extern DROID *FindATransporter(void);
|
extern DROID *FindATransporter(void);
|
||||||
|
|
||||||
/*For a given constructor droid, check if there are any damaged buildings within
|
/*For a given constructor droid, check if there are any damaged buildings within
|
||||||
a defined range*/
|
a defined range*/
|
||||||
extern BASE_OBJECT * checkForDamagedStruct(DROID *psDroid, STRUCTURE *psTarget);
|
extern BASE_OBJECT * checkForDamagedStruct(DROID *psDroid, STRUCTURE *psTarget);
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ extern UDWORD updateExtractedPower(STRUCTURE *psBuilding);
|
||||||
extern void updatePlayerPower(UDWORD player);
|
extern void updatePlayerPower(UDWORD player);
|
||||||
|
|
||||||
/** Used in multiplayer to force power levels. */
|
/** Used in multiplayer to force power levels. */
|
||||||
extern void setPower(UDWORD player, UDWORD avail);
|
extern void setPower(UDWORD player, UDWORD avail);
|
||||||
|
|
||||||
/** Get the amount of power current held by the given player. */
|
/** Get the amount of power current held by the given player. */
|
||||||
extern UDWORD getPower(UDWORD player);
|
extern UDWORD getPower(UDWORD player);
|
||||||
|
|
|
@ -327,7 +327,7 @@ static void proj_UpdateKills(PROJECTILE *psObj, float experienceInc)
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
BOOL proj_SendProjectile(WEAPON *psWeap, BASE_OBJECT *psAttacker, int player, int tarX, int tarY, int tarZ,
|
BOOL proj_SendProjectile(WEAPON *psWeap, BASE_OBJECT *psAttacker, int player, int tarX, int tarY, int tarZ,
|
||||||
BASE_OBJECT *psTarget, BOOL bVisible, BOOL bPenetrate, int weapon_slot)
|
BASE_OBJECT *psTarget, BOOL bVisible, BOOL bPenetrate, int weapon_slot)
|
||||||
{
|
{
|
||||||
PROJECTILE *psObj = malloc(sizeof(PROJECTILE));
|
PROJECTILE *psObj = malloc(sizeof(PROJECTILE));
|
||||||
|
|
|
@ -59,7 +59,7 @@ PROJECTILE * proj_GetFirst( void );
|
||||||
PROJECTILE * proj_GetNext( void );
|
PROJECTILE * proj_GetNext( void );
|
||||||
|
|
||||||
void proj_FreeAllProjectiles( void );
|
void proj_FreeAllProjectiles( void );
|
||||||
BOOL proj_SendProjectile(WEAPON *psWeap, BASE_OBJECT *psAttacker, int player, int tarX, int tarY, int tarZ,
|
BOOL proj_SendProjectile(WEAPON *psWeap, BASE_OBJECT *psAttacker, int player, int tarX, int tarY, int tarZ,
|
||||||
BASE_OBJECT *psTarget, BOOL bVisible, BOOL bPenetrate, int weapon_slot);
|
BASE_OBJECT *psTarget, BOOL bVisible, BOOL bPenetrate, int weapon_slot);
|
||||||
|
|
||||||
// return whether a weapon is direct or indirect
|
// return whether a weapon is direct or indirect
|
||||||
|
|
|
@ -60,7 +60,7 @@ extern SDWORD rayPointDist(SDWORD x1,SDWORD y1, SDWORD x2,SDWORD y2,
|
||||||
// point to the edge of the grid
|
// point to the edge of the grid
|
||||||
extern void getBestPitchToEdgeOfGrid(UDWORD x, UDWORD y, UDWORD direction, SDWORD *pitch);
|
extern void getBestPitchToEdgeOfGrid(UDWORD x, UDWORD y, UDWORD direction, SDWORD *pitch);
|
||||||
|
|
||||||
extern void getPitchToHighestPoint( UDWORD x, UDWORD y, UDWORD direction,
|
extern void getPitchToHighestPoint( UDWORD x, UDWORD y, UDWORD direction,
|
||||||
UDWORD thresholdDistance, SDWORD *pitch );
|
UDWORD thresholdDistance, SDWORD *pitch );
|
||||||
|
|
||||||
#endif // __INCLUDED_SRC_RAYCAST_H__
|
#endif // __INCLUDED_SRC_RAYCAST_H__
|
||||||
|
|
|
@ -124,15 +124,15 @@ static PIELIGHT getColour(int id)
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case STR_MR_STR_LOST :
|
case STR_MR_STR_LOST :
|
||||||
case STR_MR_UNITS_LOST :
|
case STR_MR_UNITS_LOST :
|
||||||
return WZCOL_MENU_SCORE_LOSS;
|
return WZCOL_MENU_SCORE_LOSS;
|
||||||
case STR_MR_STR_BLOWN_UP :
|
case STR_MR_STR_BLOWN_UP :
|
||||||
case STR_MR_UNITS_KILLED :
|
case STR_MR_UNITS_KILLED :
|
||||||
return WZCOL_MENU_SCORE_DESTROYED;
|
return WZCOL_MENU_SCORE_DESTROYED;
|
||||||
case STR_MR_UNITS_BUILT :
|
case STR_MR_UNITS_BUILT :
|
||||||
case STR_MR_UNITS_NOW :
|
case STR_MR_UNITS_NOW :
|
||||||
case STR_MR_STR_BUILT :
|
case STR_MR_STR_BUILT :
|
||||||
case STR_MR_STR_NOW :
|
case STR_MR_STR_NOW :
|
||||||
return WZCOL_MENU_SCORE_BUILT;
|
return WZCOL_MENU_SCORE_BUILT;
|
||||||
case STR_MR_LEVEL_ROOKIE :
|
case STR_MR_LEVEL_ROOKIE :
|
||||||
case STR_MR_LEVEL_GREEN :
|
case STR_MR_LEVEL_GREEN :
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern BOOL scrGroupAddDroid(void);
|
||||||
// Add droids in an area to a group
|
// Add droids in an area to a group
|
||||||
extern BOOL scrGroupAddArea(void);
|
extern BOOL scrGroupAddArea(void);
|
||||||
|
|
||||||
// Add groupless droids in an area to a group
|
// Add groupless droids in an area to a group
|
||||||
extern BOOL scrGroupAddAreaNoGroup(void);
|
extern BOOL scrGroupAddAreaNoGroup(void);
|
||||||
|
|
||||||
// Move the droids from one group to another
|
// Move the droids from one group to another
|
||||||
|
|
|
@ -845,7 +845,7 @@ BOOL scrCallConsole(void)
|
||||||
SDWORD *player;
|
SDWORD *player;
|
||||||
char **ConsoleText = NULL;
|
char **ConsoleText = NULL;
|
||||||
|
|
||||||
if (!stackPopParams(2, VAL_REF | VAL_INT, &player, VAL_REF | VAL_STRING, &ConsoleText) )
|
if (!stackPopParams(2, VAL_REF | VAL_INT, &player, VAL_REF | VAL_STRING, &ConsoleText) )
|
||||||
{
|
{
|
||||||
debug(LOG_ERROR, "scrCallConsole(): stack failed");
|
debug(LOG_ERROR, "scrCallConsole(): stack failed");
|
||||||
return false;
|
return false;
|
||||||
|
@ -881,7 +881,7 @@ BOOL scrCallBeacon(void)
|
||||||
|
|
||||||
if (!stackPopParams(5, VAL_INT, &playerTo, VAL_REF | VAL_INT, &playerFrom,
|
if (!stackPopParams(5, VAL_INT, &playerTo, VAL_REF | VAL_INT, &playerFrom,
|
||||||
VAL_REF | VAL_INT, &locX, VAL_REF | VAL_INT, &locY,
|
VAL_REF | VAL_INT, &locX, VAL_REF | VAL_INT, &locY,
|
||||||
VAL_REF | VAL_STRING, &BeaconText))
|
VAL_REF | VAL_STRING, &BeaconText))
|
||||||
{
|
{
|
||||||
debug(LOG_ERROR, "scrCallBeacon() - failed to pop parameters.");
|
debug(LOG_ERROR, "scrCallBeacon() - failed to pop parameters.");
|
||||||
return false;
|
return false;
|
||||||
|
@ -902,7 +902,7 @@ BOOL scrCallBeacon(void)
|
||||||
if(MultiMsgPlayerTo == playerTo)
|
if(MultiMsgPlayerTo == playerTo)
|
||||||
{
|
{
|
||||||
strcpy(*BeaconText,MultiplayMsg);
|
strcpy(*BeaconText,MultiplayMsg);
|
||||||
|
|
||||||
*playerFrom = MultiMsgPlayerFrom;
|
*playerFrom = MultiMsgPlayerFrom;
|
||||||
*locX = beaconX;
|
*locX = beaconX;
|
||||||
*locY = beaconY;
|
*locY = beaconY;
|
||||||
|
@ -935,7 +935,7 @@ BOOL scrCallBeacon(void)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,7 +946,7 @@ BOOL scrCallMultiMsg(void)
|
||||||
SDWORD *player, playerTo;
|
SDWORD *player, playerTo;
|
||||||
char **ConsoleText = NULL;
|
char **ConsoleText = NULL;
|
||||||
|
|
||||||
if (!stackPopParams(3, VAL_INT, &playerTo, VAL_REF | VAL_INT, &player, VAL_REF | VAL_STRING, &ConsoleText) )
|
if (!stackPopParams(3, VAL_INT, &playerTo, VAL_REF | VAL_INT, &player, VAL_REF | VAL_STRING, &ConsoleText) )
|
||||||
{
|
{
|
||||||
debug(LOG_ERROR, "scrCallMultiMsg() failed to pop parameters.");
|
debug(LOG_ERROR, "scrCallMultiMsg() failed to pop parameters.");
|
||||||
return false;
|
return false;
|
||||||
|
@ -963,7 +963,7 @@ BOOL scrCallMultiMsg(void)
|
||||||
if(MultiMsgPlayerTo == playerTo)
|
if(MultiMsgPlayerTo == playerTo)
|
||||||
{
|
{
|
||||||
strcpy(*ConsoleText,MultiplayMsg);
|
strcpy(*ConsoleText,MultiplayMsg);
|
||||||
|
|
||||||
*player = MultiMsgPlayerFrom;
|
*player = MultiMsgPlayerFrom;
|
||||||
|
|
||||||
scrFunctionResult.v.bval = true;
|
scrFunctionResult.v.bval = true;
|
||||||
|
@ -995,7 +995,7 @@ BOOL scrCallMultiMsg(void)
|
||||||
debug(LOG_ERROR, "scrCallMultiMsg: stackPushResult failed");
|
debug(LOG_ERROR, "scrCallMultiMsg: stackPushResult failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1010,7 +1010,7 @@ BOOL scrCBStructBuilt(void)
|
||||||
BOOL triggered = false;
|
BOOL triggered = false;
|
||||||
DROID **ppsDroid;
|
DROID **ppsDroid;
|
||||||
|
|
||||||
if (!stackPopParams(3, VAL_INT, &player, VAL_REF|ST_DROID, &ppsDroid, VAL_REF|ST_STRUCTURE, &ppsStructure) )
|
if (!stackPopParams(3, VAL_INT, &player, VAL_REF|ST_DROID, &ppsDroid, VAL_REF|ST_STRUCTURE, &ppsStructure) )
|
||||||
{
|
{
|
||||||
debug(LOG_ERROR, "scrCBStructBuilt() failed to pop parameters.");
|
debug(LOG_ERROR, "scrCBStructBuilt() failed to pop parameters.");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1476,7 +1476,7 @@ BOOL scrValDefLoad(SDWORD version, INTERP_VAL *psVal, char *pBuffer, UDWORD size
|
||||||
{
|
{
|
||||||
// find empty id and set track vals
|
// find empty id and set track vals
|
||||||
index = audio_SetTrackVals(pName, false, 100, 1800);
|
index = audio_SetTrackVals(pName, false, 100, 1800);
|
||||||
if (!index) //this is a NON fatal error.
|
if (!index) //this is a NON fatal error.
|
||||||
{
|
{
|
||||||
// We can't find filename of the sound for some reason.
|
// We can't find filename of the sound for some reason.
|
||||||
debug(LOG_ERROR, "Sound ID not available %s not found", pName);
|
debug(LOG_ERROR, "Sound ID not available %s not found", pName);
|
||||||
|
|
|
@ -41,7 +41,7 @@ DST_ALL_SAME
|
||||||
} SELECTIONTYPE;
|
} SELECTIONTYPE;
|
||||||
|
|
||||||
// EXTERNALLY REFERENCED FUNCTIONS
|
// EXTERNALLY REFERENCED FUNCTIONS
|
||||||
extern UDWORD selDroidSelection( UDWORD player, SELECTION_CLASS droidClass,
|
extern UDWORD selDroidSelection( UDWORD player, SELECTION_CLASS droidClass,
|
||||||
SELECTIONTYPE droidType, BOOL bOnScreen );
|
SELECTIONTYPE droidType, BOOL bOnScreen );
|
||||||
extern UDWORD selDroidDeselect ( UDWORD player );
|
extern UDWORD selDroidDeselect ( UDWORD player );
|
||||||
extern UDWORD selNumSelected ( UDWORD player );
|
extern UDWORD selNumSelected ( UDWORD player );
|
||||||
|
|
|
@ -1169,37 +1169,39 @@ BOOL structureStatsShutDown(void)
|
||||||
// TODO: The abandoned code needs to be factored out, see: saveMissionData
|
// TODO: The abandoned code needs to be factored out, see: saveMissionData
|
||||||
void handleAbandonedStructures()
|
void handleAbandonedStructures()
|
||||||
{
|
{
|
||||||
|
// FIXME: We should control the calling frequency externally from this
|
||||||
|
// function, rather than controlling the amount of times this
|
||||||
|
// function performs work internally.
|
||||||
static int lastHandled = 0;
|
static int lastHandled = 0;
|
||||||
int reductionAmount = 8;
|
int player;
|
||||||
int i;
|
|
||||||
|
|
||||||
// We only need to run once every two seconds (2000ms)
|
// We only need to run once every two seconds (2000ms)
|
||||||
if (gameTime - lastHandled < 2000)
|
if (gameTime - lastHandled < 2000)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update when we last ran
|
// Update when we last ran
|
||||||
lastHandled = gameTime;
|
lastHandled = gameTime;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (player = 0; player < MAX_PLAYERS; ++player)
|
||||||
{
|
{
|
||||||
STRUCTURE *psCurr, *psNext;
|
STRUCTURE *psCurr, *psNext;
|
||||||
|
|
||||||
for (psCurr = apsStructLists[i]; psCurr; psCurr = psNext)
|
for (psCurr = apsStructLists[player]; psCurr; psCurr = psNext)
|
||||||
{
|
{
|
||||||
// Save the next structure in the list
|
// Save the next structure in the list
|
||||||
psNext = psCurr->psNext;
|
psNext = psCurr->psNext;
|
||||||
|
|
||||||
// We are only interested in structures accruing
|
// We are only interested in structures accruing
|
||||||
if (psCurr->status == SS_BEING_BUILT
|
if (psCurr->status == SS_BEING_BUILT
|
||||||
&& psCurr->currentPowerAccrued < structPowerToBuild(psCurr))
|
&& psCurr->currentPowerAccrued < structPowerToBuild(psCurr))
|
||||||
{
|
{
|
||||||
DROID *psDroid;
|
DROID *psDroid;
|
||||||
bool beingBuilt = false;
|
bool beingBuilt = false;
|
||||||
|
|
||||||
// See is there are any droids building it
|
// See is there are any droids building it
|
||||||
for (psDroid = apsDroidLists[i];
|
for (psDroid = apsDroidLists[player];
|
||||||
psDroid;
|
psDroid;
|
||||||
psDroid = psDroid->psNext)
|
psDroid = psDroid->psNext)
|
||||||
{
|
{
|
||||||
|
@ -1210,7 +1212,7 @@ void handleAbandonedStructures()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Being worked on, nothing to see here
|
// Being worked on, nothing to see here
|
||||||
if (beingBuilt)
|
if (beingBuilt)
|
||||||
{
|
{
|
||||||
|
@ -1219,13 +1221,15 @@ void handleAbandonedStructures()
|
||||||
// Abandoned
|
// Abandoned
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int reductionAmount = 8;
|
||||||
|
|
||||||
// Work out how much power to deduct
|
// Work out how much power to deduct
|
||||||
CLIP(reductionAmount, 0, psCurr->currentPowerAccrued);
|
CLIP(reductionAmount, 0, psCurr->currentPowerAccrued);
|
||||||
|
|
||||||
// Do the reduction
|
// Do the reduction
|
||||||
psCurr->currentPowerAccrued -= reductionAmount;
|
psCurr->currentPowerAccrued -= reductionAmount;
|
||||||
addPower(i, reductionAmount);
|
addPower(player, reductionAmount);
|
||||||
|
|
||||||
// Remove the structure if no power is accrued
|
// Remove the structure if no power is accrued
|
||||||
if (!psCurr->currentPowerAccrued)
|
if (!psCurr->currentPowerAccrued)
|
||||||
{
|
{
|
||||||
|
@ -5133,7 +5137,7 @@ SDWORD getStructStatFromName(char *pName)
|
||||||
{
|
{
|
||||||
UDWORD inc;
|
UDWORD inc;
|
||||||
STRUCTURE_STATS *psStat;
|
STRUCTURE_STATS *psStat;
|
||||||
|
|
||||||
for (inc = 0; inc < numStructureStats; inc++)
|
for (inc = 0; inc < numStructureStats; inc++)
|
||||||
{
|
{
|
||||||
psStat = &asStructureStats[inc];
|
psStat = &asStructureStats[inc];
|
||||||
|
@ -6191,7 +6195,7 @@ BOOL electronicDamage(BASE_OBJECT *psTarget, UDWORD damage, UBYTE attackPlayer)
|
||||||
if (bMultiPlayer)
|
if (bMultiPlayer)
|
||||||
{
|
{
|
||||||
uint8_t giftType = DROID_GIFT, droid_count = 1;
|
uint8_t giftType = DROID_GIFT, droid_count = 1;
|
||||||
|
|
||||||
NETbeginEncode(NET_GIFT, NET_ALL_PLAYERS);
|
NETbeginEncode(NET_GIFT, NET_ALL_PLAYERS);
|
||||||
{
|
{
|
||||||
// We need to distinguish between gift types
|
// We need to distinguish between gift types
|
||||||
|
@ -6855,10 +6859,10 @@ void factoryProdAdjust(STRUCTURE *psStructure, DROID_TEMPLATE *psTemplate, BOOL
|
||||||
{
|
{
|
||||||
if (asProductionRun[factoryType][factoryInc][inc].psTemplate == psTemplate)
|
if (asProductionRun[factoryType][factoryInc][inc].psTemplate == psTemplate)
|
||||||
{
|
{
|
||||||
//adjust the prod run
|
//adjust the prod run
|
||||||
if (add) //user left clicked, so increase # in queue
|
if (add) //user left clicked, so increase # in queue
|
||||||
{
|
{
|
||||||
// Allows us to queue up more units up to MAX_IN_RUN instead of ignoring how many we have built from that queue
|
// Allows us to queue up more units up to MAX_IN_RUN instead of ignoring how many we have built from that queue
|
||||||
quantity = ++asProductionRun[factoryType][factoryInc][inc].quantity;
|
quantity = ++asProductionRun[factoryType][factoryInc][inc].quantity;
|
||||||
built = asProductionRun[factoryType][factoryInc][inc].built;
|
built = asProductionRun[factoryType][factoryInc][inc].built;
|
||||||
remaining = quantity - built;
|
remaining = quantity - built;
|
||||||
|
|
Loading…
Reference in New Issue