mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Fixes (by The_Bob):
- Fixed never ending interrupt bug (cats/bugs got interrupt when out of breath) - Added condition to interrupt code for minimal breath left to get interrupts - Tweaked timer control code git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8401 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+8
-8
@@ -15,9 +15,9 @@
|
||||
#ifdef JA2EDITOR
|
||||
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8401 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8401 (Development Build)" };
|
||||
#endif
|
||||
|
||||
// ------------------------------
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
//DEBUG BUILD VERSION
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8401 (Development Build)" };
|
||||
#elif defined (JA113DEMO)
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8401 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8401 (Development Build)" };
|
||||
#endif
|
||||
|
||||
#elif defined CRIPPLED_VERSION
|
||||
@@ -46,11 +46,11 @@
|
||||
|
||||
//RELEASE BUILD VERSION
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8401 (Development Build)" };
|
||||
#elif defined (JA113DEMO)
|
||||
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8401 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.8400 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.8401 (Development Build)" };
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22006,8 +22006,10 @@ BOOLEAN ResolvePendingInterrupt( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType )
|
||||
pInterrupter = MercPtrs[uCnt];
|
||||
if ( pInterrupter == NULL )
|
||||
continue; // not valid
|
||||
if ( pInterrupter->stats.bLife < OKLIFE || pInterrupter->bCollapsed || !pInterrupter->bActive || !pInterrupter->bInSector || pInterrupter->bActionPoints < 4 )
|
||||
if (pInterrupter->stats.bLife < OKLIFE || pInterrupter->bCollapsed || !pInterrupter->bActive || !pInterrupter->bInSector || pInterrupter->bActionPoints < 4)
|
||||
continue; // not active
|
||||
if (pInterrupter->bBreath < OKBREATH && pInterrupter->bTeam != OUR_TEAM)
|
||||
continue; // BOB: prevent NPCs from getting interrupts when out of breath
|
||||
if ( pSoldier->bTeam == pInterrupter->bTeam )
|
||||
continue; // same team
|
||||
if ( pSoldier->bSide == pInterrupter->bSide )
|
||||
|
||||
@@ -2378,7 +2378,7 @@ void ResolveInterruptsVs( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType)
|
||||
{
|
||||
pOpponent = MercPtrs[ubOpp];
|
||||
AssertNotNIL(pOpponent);
|
||||
if ( pOpponent->bActive && pOpponent->bInSector && (pOpponent->stats.bLife >= OKLIFE) && !(pOpponent->bCollapsed) )
|
||||
if ( pOpponent->bActive && pOpponent->bInSector && (pOpponent->stats.bLife >= OKLIFE) && (pOpponent->bBreath >= OKBREATH) && !(pOpponent->bCollapsed) )
|
||||
{
|
||||
if ( ubInterruptType == NOISEINTERRUPT )
|
||||
{
|
||||
|
||||
@@ -289,12 +289,12 @@ UINT32 GetNextCounterDoneTime(void)
|
||||
gliTimestampDiff = gliPerfCountNext.QuadPart - gliPerfCount.QuadPart;
|
||||
gliWaitTime = (gliTimestampDiff * FREQUENCY_CONST) / gliPerfFreq.QuadPart;
|
||||
|
||||
// if the wait time is too long/short, re-evaluate the timer and try waiting 125ms
|
||||
if (gliWaitTime > 15 * FREQUENCY_CONST) {
|
||||
// if the wait time is too long, or the "missed" step gets too long, re-evaluate the timer and try waiting 125ms
|
||||
if (gliWaitTime > 15000 || gliWaitTime < -15000) {
|
||||
gliWaitTime = 125; // in mili-seconds
|
||||
|
||||
QueryPerformanceFrequency(&gliPerfFreq);
|
||||
gliPerfCountNext.QuadPart = gliPerfCount.QuadPart + ((125 * gliPerfFreq.QuadPart) / 1000000);
|
||||
gliPerfCountNext.QuadPart = gliPerfCount.QuadPart + ((125 * gliPerfFreq.QuadPart) / FREQUENCY_CONST);
|
||||
}
|
||||
|
||||
return (UINT32)((gliWaitTime > 0) ? gliWaitTime : 0);
|
||||
|
||||
Reference in New Issue
Block a user