1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 23:50:27 +00:00

fixed race reset

This commit is contained in:
Zeno Rogue 2022-06-21 10:34:43 +02:00
parent 952b99856d
commit 3b816f46fc
2 changed files with 14 additions and 6 deletions

View File

@ -677,6 +677,7 @@ EX void reset_race() {
for(int i=0; i<multi::players; i++) { for(int i=0; i<multi::players; i++) {
auto who = shmup::pc[i]; auto who = shmup::pc[i];
if(!who) { println(hlog, "who missing"); continue; } if(!who) { println(hlog, "who missing"); continue; }
who->reset();
// this is intentionally not hrand // this is intentionally not hrand
for(int j=0; j<100; j++) { for(int j=0; j<100; j++) {

View File

@ -64,11 +64,18 @@ struct monster {
int split_owner; ///< in splitscreen mode, which player handles this int split_owner; ///< in splitscreen mode, which player handles this
int split_tick; ///< in which tick was split_owner computed int split_tick; ///< in which tick was split_owner computed
void reset() {
nextshot = 0;
stunoff = 0; blowoff = 0; fragoff = 0; footphase = 0;
inertia = Hypc; ori = Id; vel = 0;
swordangle = 0;
}
monster() { monster() {
dead = false; inBoat = false; parent = NULL; nextshot = 0; reset();
stunoff = 0; blowoff = 0; fragoff = 0; footphase = 0; no_targetting = false; refs = 1; split_tick = -1; split_owner = -1;
swordangle = 0; inertia = Hypc; ori = Id; refs = 1; no_targetting = false;
split_tick = -1; split_owner = -1; dead = false; inBoat = false; parent = NULL;
} }
eMonster get_parenttype() { return parent ? parent->type : moNone; } eMonster get_parenttype() { return parent ? parent->type : moNone; }