From 0e629eb322c646e0989025a648c0961014b80d5e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 2 Nov 2021 18:52:59 +0100 Subject: [PATCH] - sop.match_event_sprite --- source/games/sw/src/game.h | 2 +- source/games/sw/src/morph.cpp | 4 ++-- source/games/sw/src/save.cpp | 2 +- source/games/sw/src/track.cpp | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index ed7178fe6..9d0b05a2c 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1694,6 +1694,7 @@ struct SECTOR_OBJECTstruct }; DSWActor* so_actors[MAX_SO_SPRITE]; // hold the actors of the object + DSWActor* match_event_actor; // spritenum of the match event sprite int vel, // velocity vel_tgt, // target velocity @@ -1758,7 +1759,6 @@ struct SECTOR_OBJECTstruct save_vel, // save velocity save_spin_speed, // save spin speed match_event, // match number - match_event_sprite, // spritenum of the match event sprite // SO Scaling Vector Info scale_type, // type of scaling - enum controled scale_active_type, // activated by a switch or trigger diff --git a/source/games/sw/src/morph.cpp b/source/games/sw/src/morph.cpp index f24265855..2e49e5675 100644 --- a/source/games/sw/src/morph.cpp +++ b/source/games/sw/src/morph.cpp @@ -136,10 +136,10 @@ DoSOevent(short match, short state) } } - if (sop->match_event_sprite == -1) + if (sop->match_event_actor == nullptr) continue; - me_sp = &sprite[sop->match_event_sprite]; + me_sp = &sop->match_event_actor->s(); // toggle if (state == -1) diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 727fc95da..d7a230800 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -697,7 +697,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECTOR_OBJECTstruc ("save_vel", w.save_vel, def->save_vel) ("save_spin_speed", w.save_spin_speed, def->save_spin_speed) ("match_event", w.match_event, def->match_event) - ("match_event_sprite", w.match_event_sprite, def->match_event_sprite) + ("match_event_sprite", w.match_event_actor, def->match_event_actor) ("scale_type", w.scale_type, def->scale_type) ("scale_active_type", w.scale_active_type, def->scale_active_type) ("scale_dist", w.scale_dist, def->scale_dist) diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 28317e305..cd0edc702 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -1055,6 +1055,7 @@ SetupSectorObject(short sectnum, short tag) memset(sop->sectp, 0, sizeof(sop->sectp)); memset(sop->so_actors, 0, sizeof(sop->so_actors)); + sop->match_event_actor = nullptr; sop->crush_z = 0; sop->drive_angspeed = 0; sop->drive_angslide = 0; @@ -1322,7 +1323,7 @@ SetupSectorObject(short sectnum, short tag) break; case SO_MATCH_EVENT: sop->match_event = sp->lotag; - sop->match_event_sprite = SpriteNum; + sop->match_event_actor = actor; break; case SO_SET_SPEED: sop->vel = sp->lotag * 256;