Binary files source/makemix/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and sourceold/makemix/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff -uwrN source/scripts/VehicleGameObj.h sourceold/scripts/VehicleGameObj.h --- source/scripts/VehicleGameObj.h 2015-12-17 08:34:05.915039000 +1000 +++ sourceold/scripts/VehicleGameObj.h 2015-11-15 22:30:35.961039000 +1000 @@ -243,7 +243,6 @@ public: void Aquire_Turret_Bones( void ); void Release_Turret_Bones( void ); - void Reset_Sound_Effects( void ); protected: void Update_Turret( float weapon_turn, float weapon_tilt ); void Update_Sound_Effects( void ); diff -uwrN source/scripts/dllmain.cpp sourceold/scripts/dllmain.cpp --- source/scripts/dllmain.cpp 2015-12-17 08:34:05.921875000 +1000 +++ sourceold/scripts/dllmain.cpp 2015-11-15 22:30:36.068460900 +1000 @@ -354,7 +354,6 @@ Lock_Soldier_Collision_Group = (lscg)Address(tt,"Lock_Soldier_Collision_Group"); Unlock_Soldier_Collision_Group = (ulscg)Address(tt,"Unlock_Soldier_Collision_Group"); Unlock_Soldier_Collision_Group = (ulscg)Address(tt,"Unlock_Soldier_Collision_Group"); - Is_Engine_Enabled = (iea)Address(tt,"Is_Engine_Enabled"); Stop_Timer = (ss)Address(tt,"Stop_Timer"); Create_2D_Wave_Sound_Dialog_Player = (cwsdp)Address(tt,"Create_2D_Wave_Sound_Dialog_Player"); Force_Position_Update_Player = (fpup)Address(tt,"Force_Position_Update_Player"); diff -uwrN source/scripts/engine_tt.cpp sourceold/scripts/engine_tt.cpp --- source/scripts/engine_tt.cpp 2015-12-17 08:34:05.926757800 +1000 +++ sourceold/scripts/engine_tt.cpp 2015-11-15 22:30:36.251078100 +1000 @@ -204,7 +204,6 @@ SCRIPTS_API sov Set_Object_Visibility; SCRIPTS_API lscg Lock_Soldier_Collision_Group; SCRIPTS_API ulscg Unlock_Soldier_Collision_Group; -SCRIPTS_API iea Is_Engine_Enabled; SCRIPTS_API ss Stop_Timer; SCRIPTS_API cwsdp Create_2D_Wave_Sound_Dialog_Player; SCRIPTS_API fpup Force_Position_Update_Player; diff -uwrN source/scripts/engine_tt.h sourceold/scripts/engine_tt.h --- source/scripts/engine_tt.h 2015-12-17 08:34:05.950195300 +1000 +++ sourceold/scripts/engine_tt.h 2015-11-15 22:30:36.255960900 +1000 @@ -162,7 +162,6 @@ typedef void (*ulscg) (GameObject *obj); typedef int (*cwsdp) (GameObject *obj,const char *soundname); typedef void (*fpup) (GameObject *player,GameObject *obj); -typedef bool (*iea) (GameObject *obj); SCRIPTS_API extern gpl Get_Player_List; SCRIPTS_API extern gcmi Get_Current_Map_Index; SCRIPTS_API extern gm Get_Map; @@ -325,7 +324,6 @@ SCRIPTS_API extern sov Set_Object_Visibility; SCRIPTS_API extern lscg Lock_Soldier_Collision_Group; SCRIPTS_API extern ulscg Unlock_Soldier_Collision_Group; -SCRIPTS_API extern iea Is_Engine_Enabled; SCRIPTS_API extern ss Stop_Timer; SCRIPTS_API extern cwsdp Create_2D_Wave_Sound_Dialog_Player; SCRIPTS_API extern fpup Force_Position_Update_Player; diff -uwrN source/scripts/jfwcust.cpp sourceold/scripts/jfwcust.cpp --- source/scripts/jfwcust.cpp 2015-12-15 19:54:55.800781200 +1000 +++ sourceold/scripts/jfwcust.cpp 2015-11-15 22:30:36.325296800 +1000 @@ -958,7 +958,7 @@ } if (type == Get_Int_Parameter("DestroyMessage")) { - if (ObjectID) + if (!ObjectID) { Commands->Destroy_Object(Commands->Find_Object(ObjectID)); ObjectID = 0; diff -uwrN source/scripts/jfwobj.cpp sourceold/scripts/jfwobj.cpp --- source/scripts/jfwobj.cpp 2015-12-17 17:13:20.467773400 +1000 +++ sourceold/scripts/jfwobj.cpp 2015-11-15 22:30:36.389750000 +1000 @@ -2077,7 +2077,7 @@ { void Poked(GameObject *obj,GameObject *poker) { - Commands->Send_Custom_Event(obj,obj,Get_Int_Parameter("Message"),Get_Int_Parameter("Type"),0); + Commands->Send_Custom_Event(obj,obj,Get_Int_Parameter("Message"),Get_Int_Parameter("Param"),0); } }; @@ -2087,7 +2087,7 @@ { void Poked(GameObject *obj,GameObject *poker) { - Commands->Send_Custom_Event(obj,poker,Get_Int_Parameter("Message"),Get_Int_Parameter("Type"),0); + Commands->Send_Custom_Event(obj,poker,Get_Int_Parameter("Message"),Get_Int_Parameter("Param"),0); } }; @@ -2160,18 +2160,6 @@ }; REGISTER_SCRIPT(JFW_Set_HUD_Help_Text_Player, "Message:int,String:int,Color:vector3,OnceOnly:int"); -class JFW_Set_HUD_Help_Text_Zone : public ScriptImpClass -{ - void Entered(GameObject *obj,GameObject *enterer) - { - if (enterer->As_SoldierGameObj()) - { - Set_HUD_Help_Text_Player(enterer,Get_Int_Parameter("String"),Get_Vector3_Parameter("Color")); - } - } -}; -REGISTER_SCRIPT(JFW_Set_HUD_Help_Text_Zone, "String:int,Color:vector3"); - class JFW_Spawn_Projectile_Death : public ScriptImpClass { void Killed(GameObject *obj,GameObject *killer) diff -uwrN source/scripts/jmgBearHunter.cpp sourceold/scripts/jmgBearHunter.cpp --- source/scripts/jmgBearHunter.cpp 2015-11-22 15:32:21.591390600 +1000 +++ sourceold/scripts/jmgBearHunter.cpp 2015-11-15 22:30:36.475687500 +1000 @@ -90,7 +90,7 @@ if (JMG_Bear_Hunter_Game_Control::bearTransition && JMG_Bear_Hunter_Game_Control::bearTransition < 100) Commands->Start_Timer(obj,this,0.1f,7); Commands->Start_Timer(obj,this,0.1f,1); - if ((JMG_Bear_Hunter_Game_Control::gameState != JMG_Bear_Hunter_Game_Control::BossArrive || JMG_Bear_Hunter_Game_Control::remainingLives[playerId] >= 0) && Get_Player_Name(obj) && _wcsicmp(WideStringClass(Get_Player_Name(obj)), The_Game()->Get_Mvp_Name()) == 0 && _stricmp("CNC_Spawned_Soldier",Commands->Get_Preset_Name(obj))) + if ((JMG_Bear_Hunter_Game_Control::gameState != JMG_Bear_Hunter_Game_Control::BossArrive || JMG_Bear_Hunter_Game_Control::remainingLives[playerId] >= 0) && Get_Player_Name(obj) && _wcsicmp(WideStringClass(Get_Player_Name(obj)), The_Game()->Get_Mvp_Name()) == 0) switch (The_Game()->Get_Mvp_Count()) { case 0:break; @@ -3150,7 +3150,7 @@ Commands->Set_Animation(jump,"rabbitJump.rabbitJump",false,0,0.0f,90.0f,false); Commands->Attach_To_Object_Bone(obj,jump,"Bunny"); jumperId = Commands->Get_ID(jump); - obj->As_SoldierGameObj()->Set_Scale_Across_Network(1.5f); + obj->As_SoldierGameObj()->Set_Scale_Across_Network(2.0f); Commands->Start_Timer(obj,this,3.0f,1); } void JMG_Bear_Hunt_Final_Boss::Enemy_Seen(GameObject *obj,GameObject *seen) @@ -4658,7 +4658,7 @@ if (target) { float repairTargetDistance = JmgUtility::SimpleDistance(Commands->Get_Position(repairTarget),pos); - if (!repairTarget || repairTargetDistance > repairGunRange*repairGunRange || repairTargetDistance > JmgUtility::SimpleDistance(Commands->Get_Position(target),pos)) + if (repairTargetDistance > repairGunRange*repairGunRange || repairTargetDistance > JmgUtility::SimpleDistance(Commands->Get_Position(target),pos)) AttackTarget(obj,repairTarget,target,true,false); else AttackTarget(obj,repairTarget,target,true,true); @@ -4762,8 +4762,6 @@ ActionParamsStruct params; if (repairTarget) params.Set_Movement(target,1.25f,repairGunRange*0.5f,false); - else if (secondaryTarget) - params.Set_Movement(secondaryTarget,1.0f,weaponRange*0.5f,false); else params.Set_Movement(moveLocation,1.0f,repairGunRange*0.5f,false); params.MovePathfind = true; @@ -4772,13 +4770,11 @@ params.AttackCheckBlocked = false; if (repairTarget && !useRepairGun && secondaryTarget) { - params.MoveObject = secondaryTarget; params.Set_Attack(secondaryTarget,repairGun ? repairGunRange : weaponRange,0.0f,true); Commands->Action_Attack(obj,params); } - else if (target && ((repairTarget && useRepairGun) || (!repairTarget && !useRepairGun))) + else if ((repairTarget && useRepairGun) || (!repairTarget && !useRepairGun)) { - params.MoveObject = target; params.Set_Attack(target,repairGun ? repairGunRange : weaponRange,0.0f,true); Commands->Action_Attack(obj,params); } diff -uwrN source/scripts/jmgBearHunter.h sourceold/scripts/jmgBearHunter.h --- source/scripts/jmgBearHunter.h 2015-12-14 07:30:47.886335900 +1000 +++ sourceold/scripts/jmgBearHunter.h 2015-11-15 22:30:36.482523400 +1000 @@ -403,7 +403,7 @@ { current = SimplePositionNodeList; if (originalRandom == random) - return NULL; + random = 0; } } return NULL; @@ -425,7 +425,7 @@ { current = SimplePositionNodeList; if (originalRandom == random) - return NULL; + random = 0; } } return NULL; @@ -447,29 +447,7 @@ { current = SimplePositionNodeList; if (originalRandom == random) - return NULL; - } - } - return NULL; - } - SimplePositionNode *GetRandomInsideOfRangeInGroup(int value,float range,Vector3 pos) - { - range *= range; - SimplePositionNode *current = SimplePositionNodeList; - int random = Commands->Get_Random_Int(0,ObjectCount*2)+1; - int originalRandom = random; - while (current) - { - if (current->value == value && JmgUtility::SimpleDistance(current->position,pos) <= range && random) - random--; - if (!random) - return current; - current = current->next; - if (!current) - { - current = SimplePositionNodeList; - if (originalRandom == random) - return NULL; + random = 0; } } return NULL; @@ -525,7 +503,7 @@ { current = SimplePositionNodeList; if (originalRandom == random) - return NULL; + random = 0; } } return NULL; diff -uwrN source/scripts/jmgUtility.cpp sourceold/scripts/jmgUtility.cpp --- source/scripts/jmgUtility.cpp 2015-12-06 19:12:31.777742200 +1000 +++ sourceold/scripts/jmgUtility.cpp 2015-11-15 22:30:36.502054600 +1000 @@ -56,7 +56,7 @@ } else { - if (!Get_Int_Parameter("Failure_Saftey") || depth) + if (!Get_Int_Parameter("Failure_Safty") || depth) { failCount++; if (failCount < Get_Int_Parameter("Max_Failures")) @@ -80,7 +80,7 @@ failCount = 0; Send_Custom(sender,Get_Int_Parameter("Success_Custom"),param); } - else if (correctStep && (!Get_Int_Parameter("Correct_Step_Saftey") || depth)) + else if (correctStep && (!Get_Int_Parameter("Correct_Step_Safty") || depth)) Send_Custom(sender,Get_Int_Parameter("Correct_Step_Custom"),depth); } if (message == Get_Int_Parameter("Enable_Custom")) @@ -313,7 +313,7 @@ void JMG_Utility_Sync_System_Object::Created(GameObject *obj) { Force_Position_Update(obj); - Commands->Start_Timer(obj,this,0.25f,1); + Commands->Start_Timer(obj,this,2.5f,1); } void JMG_Utility_Sync_System_Object::Timer_Expired(GameObject *obj,int number) { @@ -337,11 +337,10 @@ if (The_Game()->Is_Game_Over()) return; if (syncNode) + { syncNode->id = 0; + syncNode->obj = NULL; } -void JMG_Utility_Sync_System_Object::Detach(GameObject *obj) -{ - Destroyed(obj); } JMG_Utility_Sync_System_Controller::JMG_Utility_Sync_System_Controller() { @@ -349,8 +348,8 @@ } void JMG_Utility_Sync_System_Controller::Created(GameObject *obj) { - Commands->Start_Timer(obj,this,2.5f,1); - Commands->Start_Timer(obj,this,2.5f,2); + Commands->Start_Timer(obj,this,0.25f,1); + Commands->Start_Timer(obj,this,0.25f,2); } void JMG_Utility_Sync_System_Controller::Timer_Expired(GameObject *obj,int number) { @@ -470,8 +469,6 @@ maxRange = Get_Float_Parameter("PatrolRange")*Get_Float_Parameter("PatrolRange"); if (!Has_Weapon(obj,Get_Parameter("RepaiarGun_Preset"))) Grant_Weapon(obj,Get_Parameter("RepaiarGun_Preset"),true,-1,true); - if (Has_Weapon(obj,Get_Parameter("RepaiarGun_Preset"))) - Commands->Select_Weapon(obj,Get_Parameter("RepaiarGun_Preset")); if (_stricmp(Get_Parameter("Weapon_Preset"),"null")) { if (!Has_Weapon(obj,Get_Parameter("Weapon_Preset"))) @@ -482,16 +479,10 @@ canFight = false; const AmmoDefinitionClass *ammo = Get_Weapon_Ammo_Definition(Get_Parameter("RepaiarGun_Preset"),true); if (ammo) - { repairGunRange = ammo->Range; - repairGunEffectiveRange = ammo->Range < ammo->EffectiveRange ? ammo->Range : ammo->EffectiveRange; - } ammo = Get_Weapon_Ammo_Definition(Get_Parameter("Weapon_Preset"),true); if (ammo) - { weaponRange = ammo->Range; - weaponEffectiveRange = ammo->Range < ammo->EffectiveRange ? ammo->Range : ammo->EffectiveRange; - } targetId = 0; repairTargetId = 0; actionUpdate = 0; @@ -547,42 +538,34 @@ SmartGameObj* o = current->Data(); if (Valid_Repair_Target(obj,o,playerType)) { - if (!inRange(o)) - continue; - float tempDistance = JmgUtility::SimpleDistance(pos,Commands->Get_Position(o))*Get_Vector3_Parameter("Priority[RepairTargets|C4|Beacons]").X; - if ((!repairTarget || tempDistance < nearestObject)) + float tempDistance = JmgUtility::SimpleDistance(pos,Commands->Get_Position(o)); + if ((!repairTarget || tempDistance < nearestObject) && inRange(o)) { repairTarget = o; nearestObject = tempDistance; } } } - if (Get_Vector3_Parameter("MinHP[EngineerTarget|C4|Beacon]").Y < 1.0) for (SLNode *current = GameObjManager::C4GameObjList.Head();current;current = current->Next()) { GameObject *o = (GameObject *)current->Data(); if (Valid_Repair_Target_C4(obj,o,playerType)) { - if (!inRange(o)) - continue; - float tempDistance = JmgUtility::SimpleDistance(pos,Commands->Get_Position(o))*Get_Vector3_Parameter("Priority[RepairTargets|C4|Beacons]").Y; - if ((!repairTarget || tempDistance < nearestObject)) + float tempDistance = JmgUtility::SimpleDistance(pos,Commands->Get_Position(o)); + if ((!repairTarget || tempDistance < nearestObject) && inRange(o)) { repairTarget = o; nearestObject = tempDistance; } } } - if (Get_Vector3_Parameter("MinHP[EngineerTarget|C4|Beacon]").Z < 1.0) for (SLNode *current = GameObjManager::BeaconGameObjList.Head();current;current = current->Next()) { GameObject *o = (GameObject *)current->Data(); if (Valid_Repair_Target_C4(obj,o,playerType)) { - if (!inRange(o)) - continue; - float tempDistance = JmgUtility::SimpleDistance(pos,Commands->Get_Position(o))*Get_Vector3_Parameter("Priority[RepairTargets|C4|Beacons]").Z; - if ((!repairTarget || tempDistance < nearestObject)) + float tempDistance = JmgUtility::SimpleDistance(pos,Commands->Get_Position(o)); + if ((!repairTarget || tempDistance < nearestObject) && inRange(o)) { repairTarget = o; nearestObject = tempDistance; @@ -606,13 +589,15 @@ if (target) { float repairTargetDistance = JmgUtility::SimpleDistance(Commands->Get_Position(repairTarget),pos); - if (!repairTarget || repairTargetDistance > repairGunRange*repairGunRange || repairTargetDistance > JmgUtility::SimpleDistance(Commands->Get_Position(target),pos)) + if (repairTargetDistance > repairGunRange*repairGunRange || repairTargetDistance > JmgUtility::SimpleDistance(Commands->Get_Position(target),pos)) AttackTarget(obj,repairTarget,target,true,false); else AttackTarget(obj,repairTarget,target,true,true); } else if (repairTarget) AttackTarget(obj,repairTarget,target,true,true); + else if (target) + AttackTarget(obj,target,target,false,false); if (targetUpdate) targetUpdate--; if (actionUpdate) @@ -652,8 +637,8 @@ Commands->Get_Action_Params(obj,params); Vector3 pos = Commands->Get_Position(obj); float rotation = Commands->Get_Random(0,9)*45; - pos.X += cos(rotation)*Get_Float_Parameter("PatrolRange"); - pos.Y += sin(rotation)*Get_Float_Parameter("PatrolRange"); + pos.X += cos(rotation)*1000.0f; + pos.Y += sin(rotation)*1000.0f; params.Set_Look(pos,Commands->Get_Random(1.0f,5.0f)); Commands->Action_Goto(obj,params); } @@ -671,8 +656,8 @@ Commands->Get_Action_Params(obj,params); Vector3 pos = Commands->Get_Position(obj); float rotation = Commands->Get_Random(0,9)*45; - pos.X += cos(rotation)*Get_Float_Parameter("PatrolRange"); - pos.Y += sin(rotation)*Get_Float_Parameter("PatrolRange"); + pos.X += cos(rotation)*1000.0f; + pos.Y += sin(rotation)*1000.0f; params.Set_Face_Location(pos,repeatTime); Commands->Action_Face_Location(obj,params); } @@ -723,24 +708,20 @@ actionUpdate = 15; ActionParamsStruct params; if (repairTarget) - params.Set_Movement(target,1.0f,repairGun ? repairGunEffectiveRange*0.9f : weaponEffectiveRange*0.9f,false); - else if (secondaryTarget) - params.Set_Movement(secondaryTarget,1.0f,repairGun ? repairGunEffectiveRange*0.9f : weaponEffectiveRange*0.9f,false); + params.Set_Movement(target,1.25f,repairGunRange*0.5f,false); else - params.Set_Movement(moveLocation,1.0f,repairGun ? repairGunEffectiveRange*0.9f : weaponEffectiveRange*0.9f,false); + params.Set_Movement(moveLocation,1.0f,repairGunRange*0.5f,false); params.MovePathfind = true; Commands->Action_Goto(obj,params); params.Set_Basic(this,100,100,AI_STATE_COMBAT); params.AttackCheckBlocked = false; if (repairTarget && !useRepairGun && secondaryTarget) { - params.MoveObject = secondaryTarget; params.Set_Attack(secondaryTarget,repairGun ? repairGunRange : weaponRange,0.0f,true); Commands->Action_Attack(obj,params); } - else if (target && (repairTarget && useRepairGun) || (!repairTarget && !useRepairGun)) + else if ((repairTarget && useRepairGun) || (!repairTarget && !useRepairGun)) { - params.MoveObject = target; params.Set_Attack(target,repairGun ? repairGunRange : weaponRange,0.0f,true); Commands->Action_Attack(obj,params); } @@ -771,9 +752,6 @@ if (!target || target == obj || Commands->Get_Player_Type(target) == playerType) return false; if (Get_Vector3_Parameter("MinHP[EngineerTarget|C4|Beacon]").Y < 1.0 && target->As_PhysicalGameObj() && target->As_PhysicalGameObj()->As_C4GameObj() && Get_Hitpoints(target) > Get_Max_Hitpoints(target)*Get_Vector3_Parameter("MinHP[EngineerTarget|C4|Beacon]").Y) - if (Get_C4_Attached(target) == obj) - return false; - else return true; if (Get_Vector3_Parameter("MinHP[EngineerTarget|C4|Beacon]").Z < 1.0 && target->As_PhysicalGameObj() && target->As_PhysicalGameObj()->As_BeaconGameObj() && Get_Hitpoints(target) > Get_Max_Hitpoints(target)*Get_Vector3_Parameter("MinHP[EngineerTarget|C4|Beacon]").Z) return true; @@ -1948,7 +1926,7 @@ { if (message == Get_Int_Parameter("DeployCustom")) { - if (Get_Vehicle(obj) || !Commands->Get_Health(obj)) + if (Get_Vehicle(obj)) return; const char *weap = Get_Current_Weapon(obj); if (!weap || _stricmp(weap,Get_Parameter("WeaponPreset"))) @@ -2110,13 +2088,6 @@ if (!Is_Script_Attached(enter,"JMG_Utility_Swimming_Infantry")) { Commands->Apply_Damage(enter,9999.9f,"Death",obj); - if (Commands->Is_A_Star(enter) && !Commands->Get_Health(enter)) - { - Commands->Attach_Script(enter,"JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy",""); - Set_Screen_Fade_Color_Player(enter,Get_Vector3_Parameter("WaterColor[R|G|B]").X,Get_Vector3_Parameter("WaterColor[R|G|B]").Y,Get_Vector3_Parameter("WaterColor[R|G|B]").Z,0.0f); - Set_Screen_Fade_Opacity_Player(enter,Get_Float_Parameter("WaterOpacity"),0.1f); - Set_Fog_Range_Player(obj,Get_Float_Parameter("WaterMinViewDistance"),JMG_Utility_Swimming_Zone::Get_Float_Parameter("WaterMaxViewDistance"),0.1f); - } return; } waterNode[JmgUtility::JMG_Get_Player_ID(enter)] = PlayerWaterNode(Get_Vector3_Parameter("WaterColor[R|G|B]"),Get_Float_Parameter("WaterOpacity"),Get_Float_Parameter("WaterMinViewDistance"),Get_Float_Parameter("WaterMaxViewDistance")); @@ -2124,20 +2095,20 @@ } void JMG_Utility_Swimming_Zone::Exited(GameObject *obj,GameObject *exiter) { - if (!exiter->As_SoldierGameObj()) + if (!Commands->Is_A_Star(exiter) || !exiter->As_SoldierGameObj()) return; Commands->Send_Custom_Event(obj,exiter,347340,0,0); } JMG_Utility_Swimming_Zone::PlayerWaterNode JMG_Utility_Swimming_Zone::waterNode[128] = {JMG_Utility_Swimming_Zone::PlayerWaterNode()}; -bool JMG_Utility_Swimming_Infantry::isUnderwater[128] = {false}; -bool JMG_Utility_Swimming_Infantry::isInWater[128] = {false}; +bool JMG_Utility_Swimming_Infantry::underwater[128] = {false}; +int JMG_Utility_Swimming_Infantry::waterZoneCount[128] = {0}; void JMG_Utility_Swimming_Infantry::Created(GameObject *obj) { heartBeatSoundId = 0; pantSoundId = 0; playerId = JmgUtility::JMG_Get_Player_ID(obj); - underwater = false; - waterZoneCount = 0; + underwater[playerId] = false; + waterZoneCount[playerId] = 0; startedFadeRed = false; drownTime = 0.0f; for (SLNode* node = GameObjManager::ScriptZoneGameObjList.Head(); node; node = node->Next()) @@ -2152,12 +2123,11 @@ { if (number == 1 && Commands->Get_Health(obj)) { - if (obj->As_SoldierGameObj()->Is_Crouched() && !obj->As_SoldierGameObj()->Is_Airborne() && waterZoneCount) + if (obj->As_SoldierGameObj()->Is_Crouched() && !obj->As_SoldierGameObj()->Is_Airborne() && waterZoneCount[playerId]) { - if (!underwater) + if (!underwater[playerId]) { - underwater = true; - isUnderwater[playerId] = true; + underwater[playerId] = true; DestroySoundEmitter(&pantSoundId); if (startedFadeRed) { @@ -2181,10 +2151,9 @@ } else { - if (underwater) + if (underwater[playerId]) { - underwater = false; - isUnderwater[playerId] = false; + underwater[playerId] = false; Set_Screen_Fade_Opacity_Player(obj,0.0f,0.1f); Set_Fog_Range_Player(obj,JMG_Utility_Swimming_Zone::fogMinDistance,JMG_Utility_Swimming_Zone::fogMaxDistance,0.1f); DestroySoundEmitter(&heartBeatSoundId); @@ -2205,7 +2174,7 @@ } } } - if (waterZoneCount) + if (waterZoneCount[playerId]) { const char *weap = Get_Current_Weapon(obj); if (Has_Weapon(obj,Get_Parameter("WeaponPreset")) && (!weap || _stricmp(weap,Get_Parameter("WeaponPreset")))) @@ -2227,10 +2196,9 @@ Commands->Send_Custom_Event(sender,obj,message,param,0.25f); return; } - waterZoneCount--; - if (!waterZoneCount) + waterZoneCount[playerId]--; + if (!waterZoneCount[playerId]) { - isInWater[playerId] = false; obj->As_SoldierGameObj()->Set_Can_Play_Damage_Animations(true); obj->As_SoldierGameObj()->Set_Movement_Loiters_Allowed(true); if (Has_Weapon(obj,enterWeapon)) @@ -2241,16 +2209,15 @@ } if (message == 347341) { - if (!waterZoneCount) + if (!waterZoneCount[playerId]) { - isInWater[playerId] = true; sprintf(enterWeapon,"%s",Get_Current_Weapon(obj) ? Get_Current_Weapon(obj) : ""); Grant_Weapon(obj,Get_Parameter("WeaponPreset"),true,-1,1); obj->As_SoldierGameObj()->Set_Can_Play_Damage_Animations(false); obj->As_SoldierGameObj()->Set_Movement_Loiters_Allowed(false); Commands->Set_Loiters_Allowed(obj,false); } - waterZoneCount++; + waterZoneCount[playerId]++; } } void JMG_Utility_Swimming_Infantry::Killed(GameObject *obj,GameObject *killer) @@ -2331,7 +2298,7 @@ if (vehicleGameObj && Get_Int_Parameter("DamageOccupants")) { int x = vehicleGameObj->Get_Definition().Get_Seat_Count(); - PhysicalGameObj *physicalGameObj = obj->As_PhysicalGameObj(); + PhysicalGameObj *physicalGameObj = enter->As_PhysicalGameObj(); OffenseObjectClass offenseObjectClass = OffenseObjectClass(Get_Float_Parameter("DamageAmount"),ArmorWarheadManager::Get_Warhead_Type(Get_Parameter("Warhead")),physicalGameObj ? physicalGameObj->As_ArmedGameObj() : NULL); for (int i = 0;i < x;i++) { @@ -2344,12 +2311,12 @@ if (Get_Vehicle_Driver(target) == soldierGameObj) Commands->Enable_Engine(target,false); Toggle_Fly_Mode(soldierGameObj); - Commands->Apply_Damage(soldierGameObj,1.0,"BlamoKiller",obj); + Commands->Apply_Damage(soldierGameObj,1.0,"BlamoKiller",enter); } } } } - Commands->Apply_Damage(target,Get_Float_Parameter("DamageAmount"),Get_Parameter("Warhead"),obj); + Commands->Apply_Damage(target,Get_Float_Parameter("DamageAmount"),Get_Parameter("Warhead"),enter); } if (Get_Int_Parameter("OnlyOnce")) this->Destroy_Script(); @@ -2508,7 +2475,7 @@ float ClosestDist = FLT_MAX; for (SLNode *z = GameObjManager::BuildingGameObjList.Head();z;z = z->Next()) { - if ((Get_Int_Parameter("BuildingPlayerType") == 2 || z->Data()->Get_Player_Type() == Get_Int_Parameter("BuildingPlayerType")) && (Get_Int_Parameter("CheckDeadBuildings") || !z->Data()->Is_Destroyed())) + if ((Get_Int_Parameter("BuildingPlayerType") == 2 || z->Data()->Get_Player_Type() == Get_Int_Parameter("BuildingPlayerType")) && (!Get_Int_Parameter("CheckDeadBuildings") || !z->Data()->Is_Destroyed())) { float Dist = z->Data()->Find_Closest_Poly(myPos); if (Dist < ClosestDist) @@ -2537,17 +2504,8 @@ void JMG_Utility_AI_Engineer_Repair_Target::Created(GameObject *obj) { } -void JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy::Destroyed(GameObject *obj) -{ - Set_Screen_Fade_Opacity_Player(obj,0.0f,0.0f); - Set_Fog_Range_Player(obj,JMG_Utility_Swimming_Zone::fogMinDistance,JMG_Utility_Swimming_Zone::fogMaxDistance,0.0f); -} -void JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy::Detach(GameObject *obj) -{ - Destroyed(obj); -} ScriptRegistrant JMG_Utility_Check_If_Script_Is_In_Library_Registrant("JMG_Utility_Check_If_Script_Is_In_Library","ScriptName:string,CppName:string"); -ScriptRegistrant JMG_Send_Custom_When_Custom_Sequence_Matched_Registrant("JMG_Send_Custom_When_Custom_Sequence_Matched","Success_Custom=0:int,Correct_Step_Custom=0:int,Partial_Failure_Custom=0:int,Failure_Custom=0:int,Send_To_ID=0:int,Custom_0=0:int,Custom_1=0:int,Custom_2=0:int,Custom_3=0:int,Custom_4=0:int,Custom_5=0:int,Custom_6=0:int,Custom_7=0:int,Custom_8=0:int,Custom_9=0:int,Disable_On_Success=1:int,Disable_On_Failure=0:int,Starts_Enabled=1:int,Enable_Custom=0:int,Correct_Step_Saftey=0:int,Failure_Saftey=1:int,Max_Failures=1:int"); +ScriptRegistrant JMG_Send_Custom_When_Custom_Sequence_Matched_Registrant("JMG_Send_Custom_When_Custom_Sequence_Matched","Success_Custom=0:int,Correct_Step_Custom=0:int,Partial_Failure_Custom=0:int,Failure_Custom=0:int,Send_To_ID=0:int,Custom_0=0:int,Custom_1=0:int,Custom_2=0:int,Custom_3=0:int,Custom_4=0:int,Custom_5=0:int,Custom_6=0:int,Custom_7=0:int,Custom_8=0:int,Custom_9=0:int,Disable_On_Success=1:int,Disable_On_Failure=0:int,Starts_Enabled=1:int,Enable_Custom=0:int,Correct_Step_Safty=0:int,Failure_Safty=1:int,Max_Failures=1:int"); ScriptRegistrant JMG_Utility_Change_Model_On_Timer_Registrant("JMG_Utility_Change_Model_On_Timer","Model=null:string,Time=0:float"); ScriptRegistrant JMG_Utility_Emulate_DamageableStaticPhys_Registrant("JMG_Utility_Emulate_DamageableStaticPhys","Animation=null:string,Killed_Explosion=null:string,Live_Loop_Start=-1.0:float,Live_Loop_End=-1.0:float,Live_Twitch_Start=-1.0:float,Live_Twitch_End=-1.0:float,Death_Transition_Start=-1.0:float,Death_Transition_End=-1.0:float,Death_Loop_Start=-1.0:float,Death_Loop_End=-1.0:float,Death_Twitch_Start=-1.0:float,Death_Twitch_End=-1.0:float,Live_Transition_Start=-1.0:float,Live_Transition_End=-1.0:float,Repaired_Explosion=null:string,Play_Twitches_To_Completion:int,Send_To_ID:int,Death_Message:int,Repaired_Message:int,Damage_Points:float,Death_Points:float,Heal_Points:float,Repair_Points:float,Neutral_When_Dead:int,Disable_Collision_When_Dead:int"); ScriptRegistrant JMG_Utility_Display_HUD_Info_Text_To_All_Players_On_Custom_Registrant("JMG_Utility_Display_HUD_Info_Text_All_Players_Custom","Custom:int,StringId:int,ColorRGB:Vector3,Repeatable=1:int"); @@ -2560,7 +2518,7 @@ ScriptRegistrant JMG_Utility_Sync_Object_Periodically_Registrant("JMG_Utility_Sync_Object_Periodically","Sync_Rate=1.0:float"); ScriptRegistrant JMG_Utility_Basic_Spawner_Registrant("JMG_Utility_Basic_Spawner","SpawnPreset:string,RespawnTime=0.0:float,RespawnTimeRandom=0:float,StartsEnabled=1:int,EnableMessage=0:int,SpawnLimit=-1:int,DelayOnStartup=0:int"); ScriptRegistrant JMG_Utility_Basic_Spawner_Attach_Registrant("JMG_Utility_Basic_Spawner_Attach","ControllerId:int"); -ScriptRegistrant JMG_Utility_AI_Engineer_Registrant("JMG_Utility_AI_Engineer","RepaiarGun_Preset=Weapon_RepairGun_Player:string,Weapon_Preset=Weapon_Pistol_Player:string,PatrolRange=50.0:float,BaseCenterPoint=0.0 0.0 0.0:vector3,MinHP[Soldiers|Vehicles|Turrets]=0.5 0.75 0.9:vector3,MinHP[EngineerTarget|C4|Beacon]=0.25 0.0 0.0:vector3,Priority[RepairTargets|C4|Beacons]=1.0 1.0 1.0:vector3"); +ScriptRegistrant JMG_Utility_AI_Engineer_Registrant("JMG_Utility_AI_Engineer","RepaiarGun_Preset=Weapon_RepairGun_Player:string,Weapon_Preset=Weapon_Pistol_Player:string,PatrolRange=50.0:float,BaseCenterPoint=0.0 0.0 0.0:vector3,MinHP[Soldiers|Vehicles|Turrets]=0.5 0.75 0.9:vector3,MinHP[EngineerTarget|C4|Beacon]=0.25 0.0 0.0:vector3"); ScriptRegistrant JMG_Utility_Set_Object_Visibility_For_Player_On_Custom_Registrant("JMG_Utility_Set_Object_Visibility_For_Player_On_Custom","Message:int,PlayerID:int,Visible:int"); ScriptRegistrant JMG_Utility_AI_Vehicle_Registrant("JMG_Utility_AI_Vehicle","MaxRange=25.0:float,MinAttackRange=0.0:float,FollowTarget=1:int,ReturnHome=1:int,ForceFire=0:int,VTOLHover=0.0:float,vsSoldier=1:int,vsVehicle=1:int,vsAircraft=1:int,WanderingAIGroupID=-1:int,MinRandWander=60.0:float,MaxRandWander=90.0:float,SquishInfantry=1:int,EnableTransitions=0:int,UsePathfind=1:int,DisableEngineOnArrival=1:int,WeaponError=-1.0:float,MaxHuntRange=0.0:float"); ScriptRegistrant JMG_Utility_Dynamic_Clock_Control_Registrant("JMG_Utility_Dynamic_Clock_Control",""); @@ -2576,11 +2534,11 @@ ScriptRegistrant JMG_Utility_PCT_Registrant("JMG_Utility_PCT",""); ScriptRegistrant JMG_Utility_PCT_Inaccessible_Zone_Registrant("JMG_Utility_PCT_Inaccessible_Zone",""); ScriptRegistrant JMG_Utility_PCT_Inaccessible_Zone_Attach_Registrant("JMG_Utility_PCT_Inaccessible_Zone_Attach",""); -ScriptRegistrant JMG_Utility_Display_HUD_Info_Text_All_Players_Custom_2_Registrant("JMG_Utility_Display_HUD_Info_Text_All_Players_Custom_Replace_String","Custom:int,StringId=7233:int,ReplaceString:string,ColorRGB:Vector3,Repeatable=1:int"); +ScriptRegistrant JMG_Utility_Display_HUD_Info_Text_All_Players_Custom_2_Registrant("JMG_Utility_Display_HUD_Info_Text_All_Players_Custom_Replace_String","Custom:int,StringId:int,ReplaceString:string,ColorRGB:Vector3,Repeatable=1:int"); ScriptRegistrant JMG_Utility_Display_Text_Message_To_All_Players_On_Custom_Registrant("JMG_Utility_Display_Text_Message_To_All_Players_On_Custom","Custom:int,Message:string,ColorRGB:Vector3,Repeatable=1:int"); ScriptRegistrant JMG_Utility_Set_Team_On_Create_Registrant("JMG_Utility_Set_Team_On_Create","PlayerType:int,Delay=0.0:float"); ScriptRegistrant JMG_Utility_AI_Aggressive_Melee_Registrant("JMG_Utility_AI_Aggressive_Melee","ReturnHomeSpeed=1.0:float,ReturnHomeArriveDistance=1.0:float,ChaseSpeed=1.0:float,AttackArriveDistance=0.0:float,StartAttackDistance=3.0:float,MaxHuntDistance=0.0:float,MinLooseVisibilityTime=3:int,MaxLooseVisibilityTime=6:int,NoPathfindDistance=5.0:float"); -ScriptRegistrant JMG_Utility_Infantry_Placed_Buildable_Object_Registrant("JMG_Utility_Infantry_Placed_Buildable_Object","WeaponPreset=null:string,PreviewPreset=Daves Arrow:string,DeployPreset=null:string,RepairedPreset=null:string,PlaceablePreview=null:string,UnPlaceablePreview=null:string,EnableCustom:int,DisableCustom:int,DeployCustom:int,RegainTimer:int,Cost:float,MessageColor[R|G|B]=255.0 255.0 255.0:vector3,DeploymentBlockedMessage=Cannot deploy when near buildings.:string,PlacementMessage=You can now place another :string,GrantWeapon=1:int,RegenStartsAfterRepair=1:int,MatchTeam[Preview|Deployed|Repaired]=0.0 0.0 1.0:vector3,DestroyedRegenTime=1:int"); +ScriptRegistrant JMG_Utility_Infantry_Placed_Buildable_Object_Registrant("JMG_Utility_Infantry_Placed_Buildable_Object","WeaponPreset=null:string,PreviewPreset=Daves Arrow:string,DeployPreset=null:string,RepairedPreset=null:string,PlaceablePreview=null:string,UnPlaceablePreview=null:string,EnableCustom:int,DisableCustom:int,DeployCustom:int,RegainTimer:int,Cost:float,MessageColor[R|G|B]=255.0 255.0 255.0:vector3,DeploymentBlockedMessage=Cannot deploy when near buildings or swimming.:string,PlacementMessage=You can now place another :string,GrantWeapon=1:int,RegenStartsAfterRepair=1:int,MatchTeam[Preview|Deployed|Repaired]=0.0 0.0 1.0:vector3,DestroyedRegenTime=1:int"); ScriptRegistrant JMG_Utility_Infantry_Placed_Buildable_Object_Attached_Registrant("JMG_Utility_Infantry_Placed_Buildable_Object_Attached","ScriptId:int,PlacerId:int,RepairedPreset:string,MatchTeam:int,Team:int"); ScriptRegistrant JMG_Utility_Lock_Weapon_Selection_While_Script_Attached_Registrant("JMG_Utility_Lock_Weapon_Selection_While_Script_Attached","WeaponPreset:string"); ScriptRegistrant JMG_Utility_Swim_While_In_Zone_Registrant("JMG_Utility_Swimming_Zone","WaterColor[R|G|B]=0.28 0.43 0.55:vector3,WaterOpacity=0.5:float,WaterMinViewDistance=5.0:float,WaterMaxViewDistance=15.0:float"); @@ -2592,7 +2550,6 @@ ScriptRegistrant JMG_Utility_Switch_Weapon_While_Primary_Empty_Registrant("JMG_Utility_Switch_Weapon_While_Primary_Empty","PrimaryWeapon=null:string,SecondaryWeapon=null:string,ReloadTime=0.0:float,PrimaryToSecondaryTime=-1.0:float,SecondaryToPrimaryTime=-1.0:float,IdlePrimaryAnim=null:string,IdleSecondaryAnim=null:string,PrimaryToSecondaryAnim=null:string,SecondaryToPrimaryAnim=null:string,PrimaryToSecondarySound=null:string,SecondaryToPrimarySound=null:string"); ScriptRegistrant JMG_Utility_Send_Custom_When_Near_Building_Registrant("JMG_Utility_Send_Custom_When_Near_Building","SendMessageObjectID=0:int,NearToBuildingMessage:int,FarFromBuildingMessage:int,CloseToBuildingDistance=1.0:float,BuildingPlayerType=2:int,CheckDeadBuildings=1:int,CheckRate=0.25:float"); ScriptRegistrant JMG_Utility_AI_Engineer_Repair_Target_Registrant("JMG_Utility_AI_Engineer_Repair_Target",""); -ScriptRegistrant JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy_Registrant("JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy",""); diff -uwrN source/scripts/jmgUtility.h sourceold/scripts/jmgUtility.h --- source/scripts/jmgUtility.h 2015-11-29 08:42:43.303007800 +1000 +++ sourceold/scripts/jmgUtility.h 2015-11-15 22:30:36.506937500 +1000 @@ -11,8 +11,6 @@ /*! * \brief Displays a message if the script named isn't in the scripts build on the server. -* \ScriptName - The name of the script you want to check for -* \CppName - Name of the cpp file that it is located in, you don't need the extension * \author jgray * \ingroup JmgUtility */ @@ -23,28 +21,6 @@ /*! * \brief Sends a custom when customs are sent in a certain order (kind of like a combo lock) -* \Success_Custom - Message to send when combo is entered correctly -* \Correct_Step_Custom - Message to send when one part of the combo is correct -* \Partial_Failure_Custom - Message to send when a digit is entered wrong -* \Failure_Custom - Message to send when the who combo is considered failed -* \Send_To_ID - ID of the object to send customs to -* \Custom_0 - First message needed in the combo -* \Custom_1 - Second message needed in the combo -* \Custom_2 - Third message needed in the combo -* \Custom_3 - Fourth message needed in the combo -* \Custom_4 - Fifth message needed in the combo -* \Custom_5 - Sixth message needed in the combo -* \Custom_6 - Seventh message needed in the combo -* \Custom_7 - Eighth message needed in the combo -* \Custom_8 - Ninth message needed in the combo -* \Custom_9 - Tenth message needed in the combo -* \Disable_On_Success - Only works once -* \Disable_On_Failure - Quits working after failure -* \Starts_Enabled - Is it enabled on script attach -* \Enable_Custom - Custom to enable this script -* \Correct_Step_Saftey - Does it send a correct step custom on the Custom0 step -* \Failure_Saftey - Does it count a wrong Custom0 as a failure -* \Max_Failures - How many times you can fail before its a complete failure * \author jgray * \ingroup JmgUtility */ @@ -69,31 +45,6 @@ /*! * \brief Turns an object into an object that emulates the damange system of DamageableStaticPhysics tiles -* \Animation - Animation to use for the damage animations -* \Killed_Explosion - Explosion to create when health hits 0 -* \Live_Loop_Start - Animation frame to start on when alive -* \Live_Loop_End - Animation frame to stop on when alive -* \Live_Twitch_Start - Animation frame to start on when twitching while alive -* \Live_Twitch_End - Animation frame to stop on when twitching while alive -* \Death_Transition_Start - Animation frame to start on when transitioning to death -* \Death_Transition_End - Animation frame to stop on when transitioning to death -* \Death_Loop_Start - Animation frame to start on when dead -* \Death_Loop_End - Animation frame to stop on when dead -* \Death_Twitch_Start - Animation frame to start on when twitching while dead -* \Death_Twitch_End - Animation frame to stop on when twitching while dead -* \Live_Transition_Start - Animation frame to start on when transitioning back to life -* \Live_Transition_End - Animation frame to stop on when transitioning back to life -* \Repaired_Explosion - Explosion to create when fully repaired -* \Play_Twitches_To_Completion - Can the twitch animations be interrupted -* \Send_To_ID - ID to send custom messages to -* \Death_Message - Message to send when object dies -* \Repaired_Message - Message to send when object repaired -* \Damage_Points - Points you get for damaging the object -* \Death_Points - Points you get for killing the object -* \Heal_Points - Points you get for healing the object -* \Repair_Points - Points you get for completely repairing the object -* \Neutral_When_Dead - Does the object's team switch to neutral when dead -* \Disable_Collision_When_Dead - Disable the object's collision while dead * \author jgray * \ingroup JmgUtility */ @@ -109,10 +60,6 @@ }; /*! * \brief Displays a hud message to all players on custom -* \Custom - Custom message to trigger on -* \StringId - ID of the string in strings.tbl to display -* \ColorRGB - Color of the hud message, 0.0-1.0 RGB -* \Repeatable - Can this show up multiple times * \author jgray * \ingroup JmgUtility */ @@ -121,10 +68,6 @@ }; /*! * \brief Displays a hud message to a player on custom -* \Custom - Custom message to trigger on -* \StringId - ID of the string in strings.tbl to display -* \ColorRGB - Color of the hud message, 0.0-1.0 RGB -* \Repeatable - Can this show up multiple times * \author jgray * \ingroup JmgUtility */ @@ -141,10 +84,6 @@ }; /*! * \brief On Poke sends custom to self -* \Custom - Message to send when poked -* \Param - Param to send when poked -* \Delay - How long to delay the send -* \LockoutTime - Amount of time that it has to wait before it can send again * \author jgray * \ingroup JmgUtility */ @@ -156,8 +95,6 @@ }; /*! * \brief Basic turret attach script, turrets match team of vehicle attached to, turrets are destroyed by destroy event -* \Turret_Preset - Preset of the turret -* \Bone_Name - Bone to hook the turret to * \author jgray * \ingroup JmgUtility */ @@ -171,18 +108,14 @@ }; /*! -* \brief Basic Engineer AI that will try to repair all OBJECTs in the patrol range, if an enemy gets close they will also shoot at them with their weapon preset. -* \ AI is granted the weapons if it does not have them. +* \brief Basic Engineer AI that will try to repair all OBJECTs in the patrol range, if an enemy gets close they will also shoot at them with their weapon preset. AI is granted the weapons if it does not have them. * \RepaiarGun_Preset - Weapon preset to use to repair objects * \Weapon_Preset - Weapon preset to use to attack enemies, if null the AI cannot attack enemies * \PatrolRange - Area they can wander around in and search for things to repair * \BaseCenterPoint - Center of the area they can wander in, if 0 0 0 it defaults to their create location -* \MinHP[Soldiers|Vehicles|Turrets] - HP must be below this value to be a repaireable target 0 disables the category -* \MinHP[EngineerTarget|C4|Beacon] - EngineerTarget is designated by any object with the script JMG_Utility_AI_Engineer_Repair_Target attached HP percent must be -* \ below this value. Beacon C4 means that the engineer will repair enemy beacons and C4 that currently have over this much of their max health, 1 disables it -* \ (the reason for this is is that you can make more engineers attempt to repair C4 or beacons with higher health this way) -* \Priority[RepairTargets|C4|Beacons] - This attempts to make some targets more valuable than others by tricking the AI into thinking they are further or nearer -* \ to it, this would allow you to make the AI always think beacons were super close thus it would always choose those to remove first +* \MinHP[Soldiers|Vehicles|Turrets] - HP must be below this value to be a repareable target 0 disables the category +* \MinHP[EngineerTarget|C4|Beacon] - EngineerTarget is designated by any object with the script JMG_Utility_AI_Engineer_Repair_Target attached HP percent must be below this value. Beacon C4 means that the engineer will +* \ repair enemy beacons and C4 that currently have over this much of their max health, 1 disables it (the reason for this is is that you can make more engineers attempt to repair c4 or beacons with higher health this way) * \author jgray * \ingroup JmgUtility */ @@ -192,9 +125,7 @@ float maxRange; int aiIgnorePlayers[128]; float repairGunRange; - float repairGunEffectiveRange; float weaponRange; - float weaponEffectiveRange; bool repairGun; int actionUpdate; int targetId; @@ -221,9 +152,6 @@ }; /*! * \brief Will change the visibility of an object on custom for the specified player id -* \Message - Message to trigger this script on -* \PlayerID - What player to make it visible or invisible for -* \Visible - Should the object be visible or not * \author jgray * \ingroup JmgUtility */ @@ -1158,12 +1086,14 @@ struct SyncObjectNode { int id; + GameObject *obj; float facing; Vector3 position; struct SyncObjectNode *next; SyncObjectNode(GameObject *obj) { this->id = Commands->Get_ID(obj); + this->obj = obj; this->facing = Commands->Get_Facing(obj); this->position = Commands->Get_Position(obj); this->next = NULL; @@ -1208,6 +1138,7 @@ if (!current->id) { current->id = id; + current->obj = obj; current->facing = Commands->Get_Facing(obj); current->position = Commands->Get_Position(obj); return current; @@ -1246,11 +1177,7 @@ if (syncControl.lastSyncNode[x]) { if (syncControl.lastSyncNode[x]->id) - { - GameObject *syncObject = Commands->Find_Object(syncControl.lastSyncNode[x]->id); - if (syncObject) - Force_Position_Update_Player(player,syncObject); - } + Force_Position_Update_Player(player,syncControl.lastSyncNode[x]->obj); syncControl.lastSyncNode[x] = syncControl.lastSyncNode[x]->next; } if (!syncControl.lastSyncNode[x]) @@ -1283,7 +1210,6 @@ void Timer_Expired(GameObject *obj,int number); void Killed(GameObject *obj,GameObject *killer); void Destroyed(GameObject *obj); - void Detach(GameObject *obj); public: JMG_Utility_Sync_System_Object() { @@ -1293,7 +1219,6 @@ /*! * \brief Controls all objects that have the script JMG_Utility_Sync_System_Object -* \Sync_Rate - Speed at which to sync up all the objects in the list when a player joins * \author jgray * \ingroup JmgUtility */ @@ -1308,7 +1233,6 @@ /*! * \brief Syncs object positions between the client and the server -* \Sync_Rate - How often does this object send out an update across the network * \author jgray * \ingroup JmgUtility */ @@ -1320,13 +1244,6 @@ /*! * \brief Turns a placed object into a renstyle spawner that can be sent customs like a normal object -* \SpawnPreset - Preset to spawn -* \RespawnTime - Time it takes between spawns after last object was killed -* \RespawnTimeRandom - Random time to add or subtract from the spawn time -* \StartsEnabled - Can the object spawn on script create -* \EnableMessage - Message used to enable the spawner -* \SpawnLimit - How many objects can this script spawn -* \DelayOnStartup - Day to spawn the first object when enabled * \author jgray * \ingroup JmgUtility */ @@ -1947,8 +1864,6 @@ int playerId; bool startedFadeRed; float drownTime; - bool underwater; - int waterZoneCount; void Created(GameObject *obj); void Timer_Expired(GameObject *obj,int number); void Custom(GameObject *obj,int message,int param,GameObject *sender); @@ -1958,8 +1873,8 @@ void CreateSoundEmitter(GameObject *obj,const char *model,int *soundId); void DestroySoundEmitter(int *soundId); public: - static bool isUnderwater[128]; - static bool isInWater[128]; + static bool underwater[128]; + static int waterZoneCount[128]; }; /*! @@ -2075,8 +1990,3 @@ class JMG_Utility_AI_Engineer_Repair_Target : public ScriptImpClass { void Created(GameObject *obj); }; - -class JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy : public ScriptImpClass { - void Destroyed(GameObject *obj); - void Detach(GameObject *obj); -}; \ No newline at end of file