diff -uwrN source/scripts/DefinitionMgrClass.cpp sourceold/scripts/DefinitionMgrClass.cpp --- source/scripts/DefinitionMgrClass.cpp 2017-12-14 05:25:41.203200000 +1000 +++ sourceold/scripts/DefinitionMgrClass.cpp 2016-10-31 07:17:12.340013500 +1000 @@ -340,31 +340,30 @@ unsigned long DefinitionMgrClass::Get_New_ID(uint32 class_id) { - for(int x = 0; x < _DefinitionCount; x++) + for (int i = 0;i < _DefinitionCount;i++) { - DefinitionClass *def = _SortedDefinitionArray[x]; - if (!def) + if (_SortedDefinitionArray[i]) { - continue; - } - - uint32 defId = def->Get_ID(); - if (defId >= 10000 * class_id - 40960000 && defId < 10000 * class_id - 40950000) + uint32 id = _SortedDefinitionArray[i]->Get_ID(); + if (id >= 10000 * class_id - 40960000) { - if (x == _DefinitionCount - 1) + if (id < 10000 * class_id - 40950000) { - return defId + 1; - } - - DefinitionClass *nextDef = _SortedDefinitionArray[x + 1]; - if (nextDef && nextDef->Get_ID() > defId + 1) + if (i >= _DefinitionCount - 1) + { + if (_SortedDefinitionArray[i + 1]) + { + if (_SortedDefinitionArray[i + 1]->Get_ID() > id + 1) { - return defId + 1; + return id + 1; } } } - - return (10000 * class_id - 40959999); + } + } + } + } + return 10000 * class_id - 40959999; } DefinitionClass *DefinitionMgrClass::Get_First(uint32 id,ID_TYPE type) diff -uwrN source/scripts/JMGRenetBuster.h sourceold/scripts/JMGRenetBuster.h --- source/scripts/JMGRenetBuster.h 2017-12-29 17:04:51.878600100 +1000 +++ sourceold/scripts/JMGRenetBuster.h 2017-08-19 18:40:15.922000000 +1000 @@ -783,10 +783,6 @@ char debug[220]; sprintf(debug,"msg RenCometBustersScoreSystem ERROR: Could not open save files %sBetaCMBTPlayerRecords.tmp and %sCMBTPlayerRecords.txt for writting!",SavePath,SavePath); Console_Input(debug); - if (SaveScores) - fclose(SaveScores); - if (SaveScores2) - fclose(SaveScores2); return; } while (Current) @@ -1585,9 +1581,12 @@ { Commands->Send_Custom_Event(Other,Other,7043453,25,0.0f); if (Commands->Get_Health(Hitter)) + { + OtherObj = OtherObj->next; return false; } } + } else { if (OtherObj->Type == PlayerShield && Obj->Type == PlayerShield) diff -uwrN source/scripts/JMGRenetBusters.cpp sourceold/scripts/JMGRenetBusters.cpp --- source/scripts/JMGRenetBusters.cpp 2017-12-29 17:04:51.880600100 +1000 +++ sourceold/scripts/JMGRenetBusters.cpp 2017-05-08 20:26:23.656009000 +1000 @@ -17,8 +17,10 @@ #include "WeaponBagClass.h" #include "WeaponClass.h" #include "WeaponMgr.h" +#include "GameObjManager.h" #include "MoveablePhysClass.h" #include "engine_tt.h" +#include "cTeam.h" #include "PhysicsSceneClass.h" #include "physcoltest.h" #include "VehicleGameObj.h" diff -uwrN source/scripts/JmgDeathMatch.h sourceold/scripts/JmgDeathMatch.h --- source/scripts/JmgDeathMatch.h 2017-12-29 17:04:51.881600100 +1000 +++ sourceold/scripts/JmgDeathMatch.h 2016-10-31 07:17:12.357013500 +1000 @@ -75,7 +75,7 @@ return (RP2DeathMatchSpawnNodeList = new RP2DeathMatchSpawnNode(obj)); while (Current) { - if (Current->id == id) + if (!Current->id == id) return Current; if (!Current->next) { @@ -100,12 +100,8 @@ RP2DeathMatchSpawnNodeList = Current->next; else Prev->next = Current->next; - RP2DeathMatchSpawnNode *temp = Current; - Current = Current->next; - delete temp; - continue; + delete Current; } - Prev = Current; Current = Current->next; } return *this; diff -uwrN source/scripts/jmgBearHunter.cpp sourceold/scripts/jmgBearHunter.cpp --- source/scripts/jmgBearHunter.cpp 2017-12-29 17:04:51.884600100 +1000 +++ sourceold/scripts/jmgBearHunter.cpp 2017-11-23 09:14:58.441800000 +1000 @@ -19,6 +19,7 @@ #include "GameObjManager.h" #include "MoveablePhysClass.h" #include "engine_tt.h" +#include "cTeam.h" #include "PhysicsSceneClass.h" #include "physcoltest.h" #include "VehicleGameObj.h" @@ -735,7 +736,7 @@ Commands->Fade_Background_Music("SpecForce_Moments01.mp3",5000,5000); } } - else if (alarmSwitchActive) + else if (!easTowers[0].activeTime && alarmSwitchActive) { alarmSwitchActive = false; sprintf(currentSong,atCabin ? "03-ammoclip.mp3" : "SpecForce_Sneak_02.mp3"); @@ -1130,7 +1131,8 @@ int deerCount = JmgUtility::MathClampInt(3+(int)(0.33f*Get_Player_Count()),3,25); for (int x = 0;x < deerCount;x++) { - if (Commands->Find_Object(JMG_Bear_Hunter_Golden_Deer_Statue::tinyDeerIds[x])) + GameObject *tinyDeer = Commands->Find_Object(JMG_Bear_Hunter_Golden_Deer_Statue::tinyDeerIds[x]); + if (tinyDeer) continue; Vector3 playerPos = Commands->Get_Position(statuePlayer); if (BearHunterGameControlSystem.getRandomPosition(&playerPos,500.0f,2500.0f)) @@ -1385,7 +1387,7 @@ for (int x = 0;x < 5;x++) { GameObject *ai = Commands->Find_Object(JMG_Bear_Hunter_Engineer_AI::engineerIds[x]); - if (!ai && (JMG_Bear_Hunter_Engineer_AI::engineerMode[x] || !engineerSpawnedOnce[x])) + if (!ai && (JMG_Bear_Hunter_Engineer_AI::engineerMode[x] || (!JMG_Bear_Hunter_Engineer_AI::engineerMode[x] && !engineerSpawnedOnce[x]))) { Vector3 createPosition = engineerSpawnLocations[x]; if (JMG_Bear_Hunter_Engineer_AI::engineerMode[x]) @@ -1691,6 +1693,7 @@ GameObject *switchObj = Commands->Find_Object(easTowers[0].id); if (switchObj) { + Vector3 switchPos = Commands->Get_Position(switchObj); if (easTowers[0].activeTime) { smoothFade = true; @@ -2260,6 +2263,7 @@ else { stuckCount = 40; + Vector3 pos = Commands->Get_Position(obj); pos.Z += 1.25f; MoveablePhysClass *mphys = obj->As_PhysicalGameObj() ? obj->As_PhysicalGameObj()->Peek_Physical_Object()->As_MoveablePhysClass() : NULL; if (mphys && mphys->Can_Teleport(Matrix3D(pos))) @@ -3319,6 +3323,7 @@ Commands->Start_Timer(obj,this,0.1f,1); else { + GameObject *jumper = Commands->Find_Object(jumperId); if (jumper) Commands->Destroy_Object(jumper); Set_Skin(obj,"BossRabbitHealth"); @@ -3342,10 +3347,10 @@ sprintf(Anim,"%s.%s",ModelName,ModelName); Commands->Set_Animation(light,Anim,true,0,AnimationFrame,-1,false); char bonename[32]; - for (int y = 0;y < 2;y++) + for (int x = 0;x < 2;x++) { GameObject *lightEffect = Commands->Create_Object("Warning_Light_EffectN",Commands->Get_Position(light)); - sprintf(bonename,"LightPos%d",y+1); + sprintf(bonename,"LightPos%d",x+1); Commands->Attach_To_Object_Bone(lightEffect,light,bonename); } } @@ -3511,7 +3516,7 @@ { if (!attackingPlayer) { - pos = Commands->Get_Position(obj); + Vector3 pos = Commands->Get_Position(obj); GameObject *closestStar = NULL; float closestDist = 0; for (int x = 0;x < maxTotalBearHunterPlayerAssistAI;x++) @@ -4230,8 +4235,11 @@ if (message == Get_Int_Parameter("AlarmTriggerMessage") && param && switchPosition == 1) { waitingToDeactivate = false; + if (param) + { UpdateTower(2); Commands->Send_Custom_Event(obj,obj,Get_Int_Parameter("AlarmTriggerMessage"),1,(float)param); + } GameObject *notifyObject = Commands->Find_Object(Get_Int_Parameter("NotifyId")); if (notifyObject) Commands->Send_Custom_Event(obj,notifyObject,Get_Int_Parameter("NotifyMessage"),param,0); @@ -7403,6 +7411,7 @@ Commands->Start_Timer(obj,this,0.1f,1); else { + GameObject *jumper = Commands->Find_Object(jumperId); if (jumper) Commands->Destroy_Object(jumper); Set_Skin(obj,"BossRabbitHealth"); diff -uwrN source/scripts/jmgMetroid.cpp sourceold/scripts/jmgMetroid.cpp --- source/scripts/jmgMetroid.cpp 2017-12-29 17:04:51.886600100 +1000 +++ sourceold/scripts/jmgMetroid.cpp 2017-11-23 09:14:58.444800000 +1000 @@ -15,11 +15,14 @@ #include "engine.h" #include "SoldierGameObj.h" #include "WeaponBagClass.h" +#include "WeaponClass.h" #include "WeaponMgr.h" #include "GameObjManager.h" #include "MoveablePhysClass.h" #include "engine_tt.h" +#include "cTeam.h" #include "PhysicsSceneClass.h" +#include "physcoltest.h" #include "VehicleGameObj.h" #include "jmgUtility.h" @@ -1554,7 +1557,7 @@ if (TargetID == IgnoreID) return; float TempDist = JmgUtility::SimpleDistance(Commands->Get_Position(obj),Commands->Get_Position(seen)); - if (TempDist >= MinDistance && TempDist <= MaxDistance && (!SeenID || SeenID == TargetID || TempDist < TargetDistance)) + if (TempDist >= MinDistance && TempDist <= MaxDistance && (!SeenID || SeenID == TargetID || (SeenID && TempDist < TargetDistance))) { TargetDistance = TempDist; ClearTarget = Get_Int_Parameter("AttackTimer"); @@ -3318,7 +3321,6 @@ char Delim = Get_Parameter("Delim")[0]; int StringLength = strlen(Get_Parameter("Values")); char Value[2000]; - sprintf(Value,"\0"); int strPos = 0; int DamagePos = 0; for (int x = 0;x < 256;x++) diff -uwrN source/scripts/jmgUtility.cpp sourceold/scripts/jmgUtility.cpp --- source/scripts/jmgUtility.cpp 2017-12-29 17:04:51.889600100 +1000 +++ sourceold/scripts/jmgUtility.cpp 2017-11-23 09:14:58.448800000 +1000 @@ -1140,15 +1140,18 @@ useAmmo = ammo; lastHealth = Commands->Get_Health(target); attacking = true; + Vector3 pos = Commands->Get_Position(target); mypos = Commands->Get_Position(obj); if (Get_Int_Parameter("FollowTarget")) { moving = true; + ActionParamsStruct params; AttackMove(obj,target,true,Vector3(),useAmmo,0.0f,false,Get_Float_Parameter("MaxRange")); } else { moving = false; + ActionParamsStruct params; AttackMove(obj,target,false,currentAction.position,useAmmo,0.0f,false,Get_Float_Parameter("MaxRange")); } Commands->Start_Timer(obj,this,1.0f,3);