From 3b816f46fccbd8e097c2f224a504b9df0df7dc39 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 21 Jun 2022 10:34:43 +0200 Subject: [PATCH] fixed race reset --- racing.cpp | 1 + shmup.cpp | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/racing.cpp b/racing.cpp index ec62eca8..ed483c25 100644 --- a/racing.cpp +++ b/racing.cpp @@ -677,6 +677,7 @@ EX void reset_race() { for(int i=0; ireset(); // this is intentionally not hrand for(int j=0; j<100; j++) { diff --git a/shmup.cpp b/shmup.cpp index 70c1969b..3f621451 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -64,13 +64,20 @@ struct monster { int split_owner; ///< in splitscreen mode, which player handles this int split_tick; ///< in which tick was split_owner computed - monster() { - dead = false; inBoat = false; parent = NULL; nextshot = 0; - stunoff = 0; blowoff = 0; fragoff = 0; footphase = 0; no_targetting = false; - swordangle = 0; inertia = Hypc; ori = Id; refs = 1; - split_tick = -1; split_owner = -1; + void reset() { + nextshot = 0; + stunoff = 0; blowoff = 0; fragoff = 0; footphase = 0; + inertia = Hypc; ori = Id; vel = 0; + swordangle = 0; } - + + monster() { + reset(); + refs = 1; split_tick = -1; split_owner = -1; + no_targetting = false; + dead = false; inBoat = false; parent = NULL; + } + eMonster get_parenttype() { return parent ? parent->type : moNone; } void store();