dual:: cshpos fixup to save all

This commit is contained in:
Zeno Rogue 2019-05-30 16:17:17 +02:00
parent 7d086da036
commit 5110a29d4d
3 changed files with 7 additions and 2 deletions

View File

@ -4062,6 +4062,7 @@ int stayval(cell *c, flagtype mf) {
} }
int totalbulldistance(cell *c, int k) { int totalbulldistance(cell *c, int k) {
shpos.resize(SHSIZE);
int tbd = 0; int tbd = 0;
for(int p=0; p<numplayers(); p++) { for(int p=0; p<numplayers(); p++) {
cell *c2 = shpos[p][(cshpos+SHSIZE-k-1)%SHSIZE]; cell *c2 = shpos[p][(cshpos+SHSIZE-k-1)%SHSIZE];
@ -5069,12 +5070,13 @@ void movemutant() {
} }
} }
cell *shpos[MAXPLAYER][SHSIZE]; __typeof(shpos) shpos;
int cshpos = 0; int cshpos = 0;
cell *lastmountpos[MAXPLAYER]; cell *lastmountpos[MAXPLAYER];
void clearshadow() { void clearshadow() {
shpos.resize(SHSIZE);
for(int i=0; i<SHSIZE; i++) for(int p=0; p<MAXPLAYER; p++) for(int i=0; i<SHSIZE; i++) for(int p=0; p<MAXPLAYER; p++)
shpos[p][i] = NULL; shpos[p][i] = NULL;
} }
@ -5083,6 +5085,7 @@ void moveshadow() {
cell *shfrom = NULL; cell *shfrom = NULL;
shpos.resize(SHSIZE);
for(int p=0; p<numplayers(); p++) { for(int p=0; p<numplayers(); p++) {
cell *c = shpos[p][cshpos]; cell *c = shpos[p][cshpos];
if(c && c->monst == moShadow) { if(c && c->monst == moShadow) {

View File

@ -2318,7 +2318,8 @@ color_t darkena(color_t c, int lev, int a);
#define SHSIZE 16 #define SHSIZE 16
extern cell *shpos[MAXPLAYER][SHSIZE];
extern vector<array<cell*, MAXPLAYER>> shpos;
extern int cshpos; extern int cshpos;
#if CAP_ANIMATIONS #if CAP_ANIMATIONS

View File

@ -1395,6 +1395,7 @@ addHook(hooks_gamedata, 0, [] (gamedata* gd) {
gd->store(gravity_state); gd->store(gravity_state);
gd->store(last_gravity_state); gd->store(last_gravity_state);
gd->store(shpos); gd->store(shpos);
gd->store(cshpos);
}) + }) +
addHook(hooks_removecells, 0, [] () { addHook(hooks_removecells, 0, [] () {
eliminate_if(crush_next, is_cell_removed); eliminate_if(crush_next, is_cell_removed);