1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 15:00:26 +00:00

shmup/centerpc:: some sanity checks to prevent the PC from disappearing

This commit is contained in:
Zeno Rogue 2019-05-30 17:47:45 +02:00
parent db38e0a271
commit e81912c11e
2 changed files with 3 additions and 1 deletions

View File

@ -1154,6 +1154,7 @@ void centerpc(ld aspd) {
DEBBI(DF_GRAPH, ("center pc"));
ors::unrotate(cwtV); ors::unrotate(View);
if(invalid_matrix(cwtV)) return;
transmatrix T = cwtV;
#if MAXMDIM >= 4

View File

@ -1014,7 +1014,7 @@ void monster::store() {
}
void monster::findpat() {
isVirtual = !gmatrix.count(base);
isVirtual = !gmatrix.count(base) || invalid_matrix(gmatrix[base]);
if(!isVirtual) pat = gmatrix[base] * at;
else pat = at;
}
@ -3546,6 +3546,7 @@ void init() {
pc[i]->at = Id;
else
pc[i]->at = spin(2*M_PI*i/players) * xpush(firstland == laMotion ? .5 : .3) * Id;
pc[i]->pat = pc[i]->at;
pc[i]->base = cwt.at;
pc[i]->vel = 0;
pc[i]->inBoat = (firstland == laCaribbean || firstland == laOcean || firstland == laLivefjord ||