mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fixed buffer overrun for LUA strings
Made direction variables more consistent as unsigned chars. Several function prototypes updated for this. Many memory leaks plugged: External options, video overlays, laptop file lists, tactical message queue, strategic pathing, autobandage, merc hiring, detailed placements, crate in Drassen, tactical placement New functions and attributes for soldiers in LUA (still for debugging at best): Soldier.APs (current APs), Soldier.changestance (changes stance, uses game heights) File catalog ignores .SVN directories (game load speedup) Fix CTD in mouse regions JA2 window now refuses to move to negative coords Checks to prevent DirectX-related infinite loops due to minimizing and task switching Invading enemies should now appear on the borders even when reinforcements disabled in .ini Suppression should no longer work on mercs in medium water Infant/Young creatures use restored spit instead of Molotov Creatures begin with their 'guns' (spit) 'locked and loaded' (cartridge in chamber) Further fix to AXP and AlaarDB's weapon ready check: Now 'firing' is always counted as 'ready'. Prevent mercs from falling and flying back through obstacles Check whether battle group is even set before testing its location for battle setup Burst spread locations now limited to 6, the limit within the soldier struct Extra burst spread locations zeroed out so that they aren't used unless necessary Spread code now only shoots at locations in the spread, and will shoot at all 6 Only mercs in the sector where autobandage happens will be made to stand up after it's done Throwing a grenade at the tail of the plane in Drassen should not result in a CTD Reset attack busy count when loading a new sector git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1347 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+11
-12
@@ -85,6 +85,7 @@
|
||||
#include "qarray.h"
|
||||
#include "environment.h"
|
||||
#include "Map Information.h"
|
||||
#include "Soldier Control.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -246,8 +247,6 @@ void SetUIbasedOnStance( SOLDIERTYPE *pSoldier, INT8 bNewStance );
|
||||
INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, UINT16 usMapPos, UINT32 uiFlags );
|
||||
INT8 UIHandleInteractiveTilesAndItemsOnTerrain( SOLDIERTYPE *pSoldier, INT16 usMapPos, BOOLEAN fUseOKCursor, BOOLEAN fItemsOnlyIfOnIntTiles );
|
||||
|
||||
extern void EVENT_InternalSetSoldierDesiredDirection( SOLDIERTYPE *pSoldier, UINT16 usNewDirection, BOOLEAN fInitalMove, UINT16 usAnimState );
|
||||
|
||||
extern BOOLEAN gfExitDebugScreen;
|
||||
extern INT8 gCurDebugPage;
|
||||
extern BOOLEAN gfGetNewPathThroughPeople;
|
||||
@@ -1238,7 +1237,7 @@ UINT32 UIHandleTestHit( UI_EVENT *pUIEvent )
|
||||
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugAttackBusy( "Testing a hit.\n" );
|
||||
EVENT_SoldierGotHit( pSoldier, 1, bDamage, 10, pSoldier->bDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, pSoldier->bAimShotLocation, 0, NOWHERE );
|
||||
EVENT_SoldierGotHit( pSoldier, 1, bDamage, 10, pSoldier->ubDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, pSoldier->bAimShotLocation, 0, NOWHERE );
|
||||
// callahan update end - put everything as it was
|
||||
}
|
||||
return( GAME_SCREEN );
|
||||
@@ -2136,7 +2135,7 @@ UINT32 UIHandleMAdjustStanceMode( UI_EVENT *pUIEvent )
|
||||
// IF we are on a basic level...(temp)
|
||||
if ( pSoldier->bLevel == 0 )
|
||||
{
|
||||
if ( FindHeigherLevel( pSoldier, pSoldier->sGridNo, pSoldier->bDirection, &bNewDirection ) )
|
||||
if ( FindHeigherLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &bNewDirection ) )
|
||||
{
|
||||
ubNearHeigherLevel = TRUE;
|
||||
}
|
||||
@@ -2145,7 +2144,7 @@ UINT32 UIHandleMAdjustStanceMode( UI_EVENT *pUIEvent )
|
||||
// IF we are higher...
|
||||
if ( pSoldier->bLevel > 0 )
|
||||
{
|
||||
if ( FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->bDirection, &bNewDirection ) )
|
||||
if ( FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &bNewDirection ) )
|
||||
{
|
||||
ubNearLowerLevel = TRUE;
|
||||
}
|
||||
@@ -3000,7 +2999,7 @@ void GetMercClimbDirection( UINT8 ubSoldierID, BOOLEAN *pfGoDown, BOOLEAN *pfGoU
|
||||
if ( pSoldier->bLevel == 0 )
|
||||
{
|
||||
// See if we are not in a building!
|
||||
if ( FindHeigherLevel( pSoldier, pSoldier->sGridNo, pSoldier->bDirection, &bNewDirection ) )
|
||||
if ( FindHeigherLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &bNewDirection ) )
|
||||
{
|
||||
*pfGoUp = TRUE;
|
||||
}
|
||||
@@ -3009,7 +3008,7 @@ void GetMercClimbDirection( UINT8 ubSoldierID, BOOLEAN *pfGoDown, BOOLEAN *pfGoU
|
||||
// IF we are higher...
|
||||
if ( pSoldier->bLevel > 0 )
|
||||
{
|
||||
if ( FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->bDirection, &bNewDirection ) )
|
||||
if ( FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &bNewDirection ) )
|
||||
{
|
||||
*pfGoDown = TRUE;
|
||||
}
|
||||
@@ -4571,7 +4570,7 @@ UINT32 UIHandleLCOnTerrain( UI_EVENT *pUIEvent )
|
||||
sFacingDir = GetDirectionFromXY( sXPos, sYPos, pSoldier );
|
||||
|
||||
// Set # of APs
|
||||
if ( sFacingDir != pSoldier->bDirection )
|
||||
if ( sFacingDir != pSoldier->ubDirection )
|
||||
{
|
||||
gsCurrentActionPoints = GetAPsToLook( pSoldier );
|
||||
gfUIHandleShowMoveGrid = FALSE;
|
||||
@@ -4627,7 +4626,7 @@ BOOLEAN MakeSoldierTurn( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos )
|
||||
// Get direction from mouse pos
|
||||
sFacingDir = GetDirectionFromXY( sXPos, sYPos, pSoldier );
|
||||
|
||||
if ( sFacingDir != pSoldier->bDirection )
|
||||
if ( sFacingDir != pSoldier->ubDirection )
|
||||
{
|
||||
sAPCost = GetAPsToLook( pSoldier );
|
||||
|
||||
@@ -5341,7 +5340,7 @@ UINT32 UIHandleJumpOver( UI_EVENT *pUIEvent )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT16 usMapPos;
|
||||
INT8 bDirection;
|
||||
UINT8 ubDirection;
|
||||
|
||||
// Here, first get map screen
|
||||
if ( !GetSoldier( &pSoldier, gusSelectedSoldier ) )
|
||||
@@ -5366,11 +5365,11 @@ UINT32 UIHandleJumpOver( UI_EVENT *pUIEvent )
|
||||
pSoldier->ubPendingAction = NO_PENDING_ACTION;
|
||||
|
||||
// Get direction to goto....
|
||||
bDirection = (INT8)GetDirectionFromGridNo( usMapPos, pSoldier );
|
||||
ubDirection = GetDirectionFromGridNo( usMapPos, pSoldier );
|
||||
|
||||
|
||||
pSoldier->fDontChargeTurningAPs = TRUE;
|
||||
EVENT_InternalSetSoldierDesiredDirection( pSoldier, bDirection, FALSE, pSoldier->usAnimState );
|
||||
EVENT_SetSoldierDesiredDirection( pSoldier, ubDirection);
|
||||
pSoldier->fTurningUntilDone = TRUE;
|
||||
// ATE: Reset flag to go back to prone...
|
||||
//pSoldier->fTurningFromPronePosition = TURNING_FROM_PRONE_OFF;
|
||||
|
||||
Reference in New Issue
Block a user