From 3bc56d267c6e032bf115becdb4017f2d32209b36 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 26 Jun 2011 13:00:31 +0000 Subject: [PATCH] Polymost: crash prevention for bad pal sprites (and warning in Mapster 3D mode) git-svn-id: https://svn.eduke32.com/eduke32@1920 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymost.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index c9419685a..484896b45 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -2033,6 +2033,16 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) if (skyclamphack) method |= 4; pth = gltexcache(globalpicnum,globalpal,method&(~3)); + if (!pth) + { + if (editstatus) + { + Bsprintf(ptempbuf, "pth==NULL! (bad pal?) pic=%d pal=%d", globalpicnum, globalpal); + polymost_printext256(8,8, editorcolors[15],editorcolors[5], ptempbuf, 0); + } + return; + } + if (r_fullbrights && pth->flags & 16) if (indrawroomsandmasks) {