Skip to content

Commit

Permalink
Fix class array usage
Browse files Browse the repository at this point in the history
  • Loading branch information
wallabra committed Aug 31, 2024
1 parent 4313d2a commit 22ad061
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wadsrc/static/zscript/actors/shared/randomspawner.zs
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ class RandomSpawnerTracker : Thinker {
self.size--;
}

void RegisterSpawn(Actor from, Actor dest) {
void RegisterSpawn(Actor from, Actor spawned) {
let root = from.GetClass();

// find intermediary link to remove
// (this prevents intermediary spawns from lingering without GC)
for (int i = 0; i < size; i++) {
if (self.dest[i] == from) {
if (dest[i] == from) {
root = self.origin[i];
self.Delete(i);
break;
}
}

self.origin.Append(root);
self.dest.Append(dest);
self.destClass.append(dest);
origin.Push(root);
dest.Push(spawned);
destClass.Push(spawned.GetClass());
size++;
}

Expand Down

0 comments on commit 22ad061

Please sign in to comment.