Skip to content

Commit

Permalink
Fix HX PrecessorName and fix reading beyond array limits in DXREvents
Browse files Browse the repository at this point in the history
  • Loading branch information
theastropath committed Jun 25, 2023
1 parent 2bb30b5 commit 27739cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
5 changes: 5 additions & 0 deletions DXRCore/DeusEx/Classes/DXRActorsBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,11 @@ function Actor SpawnReplacement(Actor a, class<Actor> newclass, optional bool do
newactor.LightHue=a.LightHue;
newactor.LightRadius=a.LightRadius;
}
if(#defined(hx)){
newactor.SetPropertyText("PrecessorName", a.GetPropertyText("PrecessorName"));
}

return newactor;
}

Expand Down
4 changes: 2 additions & 2 deletions DXRModules/DeusEx/Classes/DXREvents.uc
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ simulated function _CreateBingoBoard(PlayerDataItem data)
local int x, y, i;
local string event, desc;
local int progress, max, missions, starting_mission_mask, starting_mission;
local int options[200], num_options, slot, free_spaces;
local int options[ArrayCount(bingo_options)], num_options, slot, free_spaces;
local float f;

starting_mission = class'DXRStartMap'.static.GetStartMapMission(dxr.flags.settings.starting_map);
Expand Down Expand Up @@ -1645,7 +1645,7 @@ simulated function _CreateBingoBoard(PlayerDataItem data)
data.ExportBingoState();
}

simulated function int HandleMutualExclusion(MutualExclusion m, int options[200], int num_options) {
simulated function int HandleMutualExclusion(MutualExclusion m, int options[ArrayCount(bingo_options)], int num_options) {
local int a, b, overwrite;

for(a=0; a<num_options; a++) {
Expand Down
29 changes: 5 additions & 24 deletions DXRModules/DeusEx/Classes/DXRReplaceActors.uc
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ function ReplaceShipsWheel(#var(prefix)ShipsWheel a)

// probably doesn't need this since it's all defaults
//ReplaceDecoration(a, n);
#ifdef hx
n.PrecessorName = a.PrecessorName;
#endif

a.Destroy();
}

Expand All @@ -207,9 +205,7 @@ function ReplaceWaterFountain(#var(prefix)WaterFountain a)

// probably doesn't need this since it's all defaults
//ReplaceDecoration(a, n);
#ifdef hx
n.PrecessorName = a.PrecessorName;
#endif

a.Destroy();
}

Expand All @@ -222,9 +218,7 @@ function ReplaceWaterCooler(#var(prefix)WaterCooler a)

// probably doesn't need this since it's all defaults
//ReplaceDecoration(a, n);
#ifdef hx
n.PrecessorName = a.PrecessorName;
#endif

a.Destroy();
}

Expand All @@ -239,9 +233,7 @@ function ReplacePoolball(#var(prefix)Poolball a)
n.Skin = a.Skin;
// probably doesn't need this since it's all defaults
//ReplaceDecoration(a, n);
#ifdef hx
n.PrecessorName = a.PrecessorName;
#endif

a.Destroy();
}

Expand All @@ -254,9 +246,6 @@ function ReplaceGenericDecoration(Actor a, class<Actor> newClass)
if(n == None)
return;

#ifdef hx
HXActor(n).PrecessorName = HXActor(a).PrecessorName;
#endif
a.Destroy();
}

Expand All @@ -271,9 +260,7 @@ function ReplaceToilet(#var(prefix)Toilet a)
n.Skin = a.Skin;
// probably doesn't need this since it's all defaults
//ReplaceDecoration(a, n);
#ifdef hx
n.PrecessorName = a.PrecessorName;
#endif

a.Destroy();
}

Expand Down Expand Up @@ -348,9 +335,6 @@ function ReplaceTrigger(#var(prefix)Trigger a, #var(prefix)Trigger n)
n.DamageThreshold = a.DamageThreshold;
n.TriggerActor = a.TriggerActor;
n.TriggerActor2 = a.TriggerActor2;
#ifdef hx
n.PrecessorName = a.PrecessorName;
#endif
}

#ifdef hx
Expand All @@ -373,9 +357,6 @@ function DeusExWeapon ReplaceWeapon(DeusExWeapon a, DeusExWeapon n)
owner.SetWeapon(n);
}
}
#ifdef hx
n.PrecessorName = a.PrecessorName;
#endif
}

#ifdef hx
Expand Down

0 comments on commit 27739cc

Please sign in to comment.