mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 15:00:26 +00:00
backward compatibility after changing NODIR
This commit is contained in:
parent
ea74604f34
commit
3ac1e45130
6
hyper.h
6
hyper.h
@ -2,9 +2,9 @@
|
|||||||
// It is quite chaotic.
|
// It is quite chaotic.
|
||||||
|
|
||||||
// version numbers
|
// version numbers
|
||||||
#define VER "11.0q"
|
#define VER "11.0r"
|
||||||
#define VERNUM 11017
|
#define VERNUM 11018
|
||||||
#define VERNUM_HEX 0xA611
|
#define VERNUM_HEX 0xA612
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "hyper_function.h"
|
#include "hyper_function.h"
|
||||||
|
@ -230,8 +230,12 @@ namespace mapstream {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fixspin(int rspin, int dir, int t) {
|
int fixspin(int rspin, int dir, int t, int vernum) {
|
||||||
if(dir >= 0 && dir < t)
|
if(vernum < 11018 && dir == 14)
|
||||||
|
return NODIR;
|
||||||
|
else if(vernum < 11018 && dir == 15)
|
||||||
|
return NOBARRIERS;
|
||||||
|
else if(dir >= 0 && dir < t)
|
||||||
return (dir + rspin) % t;
|
return (dir + rspin) % t;
|
||||||
else
|
else
|
||||||
return dir;
|
return dir;
|
||||||
@ -356,7 +360,7 @@ namespace mapstream {
|
|||||||
if(parent<0 || parent >= isize(cellbyid)) break;
|
if(parent<0 || parent >= isize(cellbyid)) break;
|
||||||
int dir = f.read_char();
|
int dir = f.read_char();
|
||||||
cell *c2 = cellbyid[parent];
|
cell *c2 = cellbyid[parent];
|
||||||
dir = fixspin(dir, relspin[parent], c2->type);
|
dir = fixspin(dir, relspin[parent], c2->type, vernum);
|
||||||
c = createMov(c2, dir);
|
c = createMov(c2, dir);
|
||||||
// printf("%p:%d,%d -> %p\n", c2, relspin[parent], dir, c);
|
// printf("%p:%d,%d -> %p\n", c2, relspin[parent], dir, c);
|
||||||
|
|
||||||
@ -371,7 +375,7 @@ namespace mapstream {
|
|||||||
cellbyid.push_back(c);
|
cellbyid.push_back(c);
|
||||||
relspin.push_back(rspin);
|
relspin.push_back(rspin);
|
||||||
c->land = (eLand) f.read_char();
|
c->land = (eLand) f.read_char();
|
||||||
c->mondir = fixspin(rspin, f.read_char(), c->type);
|
c->mondir = fixspin(rspin, f.read_char(), c->type, vernum);
|
||||||
c->monst = (eMonster) f.read_char();
|
c->monst = (eMonster) f.read_char();
|
||||||
if(c->monst == moTortoise && vernum >= 11001)
|
if(c->monst == moTortoise && vernum >= 11001)
|
||||||
f.read(tortoise::emap[c]);
|
f.read(tortoise::emap[c]);
|
||||||
|
Loading…
Reference in New Issue
Block a user