Permalink
Browse files

fx_play_visual_effect: check for null target earlier (potential crash)

coverity 4464
  • Loading branch information...
lynxlynxlynx committed Apr 22, 2013
1 parent 8776b90 commit 7206fda80df61a4dd01a09e271f3aedf09c1560c
Showing with 2 additions and 2 deletions.
  1. +2 −2 gemrb/plugins/FXOpcodes/FXOpcodes.cpp
@@ -5489,7 +5489,7 @@ int fx_play_visual_effect (Scriptable* /*Owner*/, Actor* target, Effect* fx)
if(0) print("fx_play_visual_effect(%2d): Resource: %s Type: %d", fx->Opcode, fx->Resource, fx->Parameter2);
//this is in the original engine (dead actors lose this effect)
- if (STATE_GET( STATE_DEAD) ) {
+ if (!target || STATE_GET(STATE_DEAD)) {
return FX_NOT_APPLIED;
}
@@ -5532,7 +5532,7 @@ int fx_play_visual_effect (Scriptable* /*Owner*/, Actor* target, Effect* fx)
}
//not sticky
- if (fx->Parameter2 == 2 || !target) {
+ if (fx->Parameter2 == 2) {
sca->XPos = fx->PosX;
sca->YPos = fx->PosY;
} else {

0 comments on commit 7206fda

Please sign in to comment.