freebsd-ports/games/cube/files/patch-entities.cpp
Jan Beich 6047e60d75 - Fix invalid dereferencing of null reference which causes startup
crash for cube_client when built with clang 3.6 + -O1 or higher [1]
- Properly track libenet dependency [2]

PR:		197604 [1]
PR:		197605 [2]
Submitted by:	dim [1]
2015-02-20 06:53:37 +00:00

15 lines
775 B
C++

--- entities.cpp.orig 2015-02-14 01:42:48.128349000 +0100
+++ entities.cpp 2015-02-14 01:44:19.309526000 +0100
@@ -25,9 +25,9 @@
entity &e = ents[i];
if(e.type==MAPMODEL)
{
- mapmodelinfo &mmi = getmminfo(e.attr2);
- if(!&mmi) continue;
- rendermodel(mmi.name, 0, 1, e.attr4, (float)mmi.rad, e.x, (float)S(e.x, e.y)->floor+mmi.zoff+e.attr3, e.y, (float)((e.attr1+7)-(e.attr1+7)%15), 0, false, 1.0f, 10.0f, mmi.snap);
+ mapmodelinfo *mmi = getmminfo(e.attr2);
+ if(!mmi) continue;
+ rendermodel(mmi->name, 0, 1, e.attr4, (float)mmi->rad, e.x, (float)S(e.x, e.y)->floor+mmi->zoff+e.attr3, e.y, (float)((e.attr1+7)-(e.attr1+7)%15), 0, false, 1.0f, 10.0f, mmi->snap);
}
else
{