Skip to content

Commit

Permalink
protecting genome soldier's hobby against non-existing objects
Browse files Browse the repository at this point in the history
  • Loading branch information
lempamo committed Jun 18, 2020
1 parent 1addb18 commit dc5608a
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions ChaosMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,18 +402,30 @@ public void EffectMiscSpawnJet() {

public void EffectMiscSPEEN() {
foreach (GTA.Object o in World.GetAllObjects()) {
if (o.Exists()) o.Heading += 5f;
try {
if (o.Exists()) o.Heading += 5f;
} catch (NonExistingObjectException) {
continue;
}
}
foreach (Vehicle v in World.GetAllVehicles()) {
if (v.Exists()) {
v.Heading += 5f;
if (v.Heading >= 355f) v.Heading = 0f;
v.ApplyForce(new Vector3(0f, 0f, 0.1f));
try {
if (v.Exists()) {
v.Heading += 5f;
if (v.Heading >= 355f) v.Heading = 0f;
v.ApplyForce(new Vector3(0f, 0f, 0.1f));
}
} catch (NonExistingObjectException) {
continue;
}
}
foreach (Ped p in World.GetAllPeds()) {
if (p.Exists() & (p != Player.Character)) {
p.Heading += 5f;
try {
if (p.Exists() & (p != Player.Character)) {
p.Heading += 5f;
}
} catch (NonExistingObjectException) {
continue;
}
}
}
Expand Down

0 comments on commit dc5608a

Please sign in to comment.