From: Jaka K. <lyn...@us...> - 2010-11-04 10:16:20
|
gemrb: Infinity Engine emulator The branch master has been updated via feb9cc9d35d05eac4e81a5868dab159692017f54 (commit) Summary of changes: gemrb/core/Scriptable/Actor.cpp | 39 ++++++++++++++++++++++++++------------- 1 files changed, 26 insertions(+), 13 deletions(-) from f1469f91659a2403a37522412b3bec87a0579906 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=feb9cc9d35d05eac4e81a5868dab159692017f54 commit feb9cc9d35d05eac4e81a5868dab159692017f54 Author: Jaka Kranjc <lyn...@us...> Date: Thu Nov 4 11:19:07 2010 +0100 don't apply the reputation penalty for injuring/killing if the attacker is not on hte player's side diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index 50b2b7f..97fd4dd 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -2705,7 +2705,20 @@ int Actor::Damage(int damage, int damagetype, Scriptable *hitter, int modtype) // also apply reputation damage if we hurt (but not killed) an innocent if (Modified[IE_CLASS] == CLASS_INNOCENT) { - core->GetGame()->SetReputation(core->GetGame()->Reputation + core->GetReputationMod(1)); + Actor *act=NULL; + if (!hitter) { + hitter = area->GetActorByGlobalID(LastHitter); + } + + if (hitter) { + if (hitter->Type==ST_ACTOR) { + act = (Actor *) hitter; + } + } + + if (act && act->GetStat(IE_EA) <= EA_CONTROLLABLE) { + core->GetGame()->SetReputation(core->GetGame()->Reputation + core->GetReputationMod(1)); + } } } @@ -3244,21 +3257,21 @@ void Actor::Die(Scriptable *killer) InternalFlags|=IF_REALLYDIED|IF_JUSTDIED; SetStance( IE_ANI_DIE ); + Actor *act=NULL; + if (!killer) { + killer = area->GetActorByGlobalID(LastHitter); + } + + if (killer) { + if (killer->Type==ST_ACTOR) { + act = (Actor *) killer; + } + } + if (InParty) { game->PartyMemberDied(this); core->Autopause(AP_DEAD); } else { - Actor *act=NULL; - if (!killer) { - killer = area->GetActorByGlobalID(LastHitter); - } - - if (killer) { - if (killer->Type==ST_ACTOR) { - act = (Actor *) killer; - } - } - if (act) { if (act->InParty) { //adjust kill statistics here @@ -3284,7 +3297,7 @@ void Actor::Die(Scriptable *killer) //give experience to party game->ShareXP(Modified[IE_XPVALUE], sharexp ); - if (!InParty) { + if (!InParty && act && act->GetStat(IE_EA) <= EA_CONTROLLABLE) { // adjust reputation if the corpse was: // an innocent, a member of the Flaming Fist or something evil int repmod = 0; ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |