fixed a possible crash while drawing ClosedGates

This commit is contained in:
Zeno Rogue 2020-02-26 22:29:58 +01:00
parent 0de0714ba5
commit 3ee3c471ca
1 changed files with 1 additions and 1 deletions

View File

@ -674,7 +674,7 @@ void celldrawer::draw_wall() {
if(c->wall == waClosedGate) {
int hdir = 0;
for(int i=0; i<c->type; i++) if(c->move(i)->wall == waClosedGate)
for(int i=0; i<c->type; i++) if(c->move(i) && c->move(i)->wall == waClosedGate)
hdir = i;
transmatrix V2 = mscale(V, wmspatial?cgi.WALL:1) * ddspin(c, hdir, M_PI);
queuepolyat(V2, cgi.shPalaceGate, darkena(wcol, 0, 0xFF), wmspatial?PPR::WALL3A:PPR::WALL);