mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-19 23:30:25 +00:00
shmup/centerpc:: some sanity checks to prevent the PC from disappearing
This commit is contained in:
parent
db38e0a271
commit
e81912c11e
@ -1154,6 +1154,7 @@ void centerpc(ld aspd) {
|
|||||||
DEBBI(DF_GRAPH, ("center pc"));
|
DEBBI(DF_GRAPH, ("center pc"));
|
||||||
|
|
||||||
ors::unrotate(cwtV); ors::unrotate(View);
|
ors::unrotate(cwtV); ors::unrotate(View);
|
||||||
|
if(invalid_matrix(cwtV)) return;
|
||||||
|
|
||||||
transmatrix T = cwtV;
|
transmatrix T = cwtV;
|
||||||
#if MAXMDIM >= 4
|
#if MAXMDIM >= 4
|
||||||
|
@ -1014,7 +1014,7 @@ void monster::store() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void monster::findpat() {
|
void monster::findpat() {
|
||||||
isVirtual = !gmatrix.count(base);
|
isVirtual = !gmatrix.count(base) || invalid_matrix(gmatrix[base]);
|
||||||
if(!isVirtual) pat = gmatrix[base] * at;
|
if(!isVirtual) pat = gmatrix[base] * at;
|
||||||
else pat = at;
|
else pat = at;
|
||||||
}
|
}
|
||||||
@ -3546,6 +3546,7 @@ void init() {
|
|||||||
pc[i]->at = Id;
|
pc[i]->at = Id;
|
||||||
else
|
else
|
||||||
pc[i]->at = spin(2*M_PI*i/players) * xpush(firstland == laMotion ? .5 : .3) * Id;
|
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]->base = cwt.at;
|
||||||
pc[i]->vel = 0;
|
pc[i]->vel = 0;
|
||||||
pc[i]->inBoat = (firstland == laCaribbean || firstland == laOcean || firstland == laLivefjord ||
|
pc[i]->inBoat = (firstland == laCaribbean || firstland == laOcean || firstland == laLivefjord ||
|
||||||
|
Loading…
Reference in New Issue
Block a user