diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index e5ee54029..1776c0ba5 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1226,7 +1226,7 @@ PostDraw(void) it.Reset(STAT_FAF_COPY); while (auto actor = it.Next()) { - actor->u()->Clear(); + actor->clearUser(); deletesprite(actor->GetSpriteIndex()); } } diff --git a/source/games/sw/src/swactor.h b/source/games/sw/src/swactor.h index a56c714a5..84b6d8080 100644 --- a/source/games/sw/src/swactor.h +++ b/source/games/sw/src/swactor.h @@ -12,21 +12,15 @@ class DSWActor public: - int cumulDamage; - DSWActor() :index(int(this - base())) { /*assert(index >= 0 && index < kMaxSprites);*/ } DSWActor& operator=(const DSWActor& other) = default; void Clear() { + clearUser(); } bool hasU() { return User[index].Data() != nullptr; } - /* - void addU() - { - if (s().extra == -1) dbInsertXSprite(s().index); - } - */ + spritetype& s() { return sprite[index]; } USER* u() { return User[index].Data(); } USER* allocUser() @@ -39,7 +33,7 @@ public: void clearUser() { - User[index].Clear(); + if (hasU()) User[index].Clear(); } int GetIndex()