- Fix: fully repairing a gun did not always clean it

- Fix: need to sleep modifiers from food were applied wrong
- Fix: under certain circumstances, player mercs won an AI interrupt, leading a deadlock or - potentially - AI-controlled player mercs

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5686 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-11-14 01:23:13 +00:00
parent 1a7e900df5
commit 51342b0669
3 changed files with 26 additions and 14 deletions
+7 -4
View File
@@ -3809,16 +3809,19 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
if ( (*pObj)[ubLoop]->data.objectStatus == threshold && (((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 4 ))
{
gMercProfiles[ pSoldier->ubProfile ].records.usItemsRepaired++;
// if item was fully repaired, consider it cleaned
if ( gGameExternalOptions.fDirtSystem )
(*pObj)[ubLoop]->data.bDirtLevel = 0.0f;
}
// if the item was now repaired to a status of 96-99 and the repair was at least 2%, add a point, consider the item repaired (no points will be awarded for it anyway)
else if ( (*pObj)[ubLoop]->data.objectStatus > threshold - 5 && (*pObj)[ubLoop]->data.objectStatus < threshold && ((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 1)
{
gMercProfiles[ pSoldier->ubProfile ].records.usItemsRepaired++;
}
if ( (*pObj)[ubLoop]->data.objectStatus == threshold )
{
// if item was fully repaired, consider it cleaned
if ( gGameExternalOptions.fDirtSystem )
(*pObj)[ubLoop]->data.bDirtLevel = 0.0f;
}
// note: this system is bad if we can repair only 1% per hour (which is rather we are total losers)
///////////////////////////////////////////////////////////////////////////////////////////////////////