diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2015-02-20 06:53:37 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2015-02-20 06:53:37 +0000 |
commit | 6047e60d752345fe4b73b22da27be4656e6d09df (patch) | |
tree | a10f654d060210d22acc8cbd368563ab82fab1b6 /games/cube/files/patch-physics.cpp | |
parent | - Fix installation path of mozc_emacs_helper. (diff) |
- 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]
Diffstat (limited to 'games/cube/files/patch-physics.cpp')
-rw-r--r-- | games/cube/files/patch-physics.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/games/cube/files/patch-physics.cpp b/games/cube/files/patch-physics.cpp new file mode 100644 index 000000000000..bc4cb6842d10 --- /dev/null +++ b/games/cube/files/patch-physics.cpp @@ -0,0 +1,22 @@ +--- physics.cpp.orig 2015-02-14 01:31:41.351723000 +0100 ++++ physics.cpp 2015-02-14 01:40:28.770647000 +0100 +@@ -46,14 +46,14 @@ + { + entity &e = ents[i]; + if(e.type!=MAPMODEL) continue; +- mapmodelinfo &mmi = getmminfo(e.attr2); +- if(!&mmi || !mmi.h) continue; +- const float r = mmi.rad+d->radius; ++ mapmodelinfo *mmi = getmminfo(e.attr2); ++ if(!mmi || !mmi->h) continue; ++ const float r = mmi->rad+d->radius; + if(fabs(e.x-d->o.x)<r && fabs(e.y-d->o.y)<r) + { +- float mmz = (float)(S(e.x, e.y)->floor+mmi.zoff+e.attr3); ++ float mmz = (float)(S(e.x, e.y)->floor+mmi->zoff+e.attr3); + if(d->o.z-d->eyeheight<mmz) { if(mmz<hi) hi = mmz; } +- else if(mmz+mmi.h>lo) lo = mmz+mmi.h; ++ else if(mmz+mmi->h>lo) lo = mmz+mmi->h; + }; + }; + }; |