diff --git a/data/trophies/trophies.json b/data/trophies/trophies.json index ec477fb..30fb49d 100644 --- a/data/trophies/trophies.json +++ b/data/trophies/trophies.json @@ -310,7 +310,7 @@ { "id" : "REVENGE", "title" : "Revenge", - "description" : "During an epic battle, kill an enemy that previously killed you", + "description" : "During an epic battle, kill the enemy that just killed you", "value" : "TROPHY_BRONZE" } ] diff --git a/src/battle/bullets.c b/src/battle/bullets.c index a451ce2..d6b8cf6 100644 --- a/src/battle/bullets.c +++ b/src/battle/bullets.c @@ -233,10 +233,10 @@ static void checkCollisions(Bullet *b) if (e == player) { - b->owner->flags |= EF_KILLED_PLAYER; + battle.lastKilledPlayer = b->owner; } - if (b->owner == player && e->flags & EF_KILLED_PLAYER) + if (b->owner == player && e == battle.lastKilledPlayer) { awardTrophy("REVENGE"); } diff --git a/src/defs.h b/src/defs.h index c35bd8f..24182cd 100644 --- a/src/defs.h +++ b/src/defs.h @@ -109,7 +109,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define EF_NO_THREAT (2 << 23) #define EF_DROPS_ITEMS (2 << 24) #define EF_COMMON_FIGHTER (2 << 25) -#define EF_KILLED_PLAYER (2 << 26) #define AIF_NONE 0 #define AIF_FOLLOWS_PLAYER (2 << 0) diff --git a/src/structs.h b/src/structs.h index ebd948a..d36d624 100644 --- a/src/structs.h +++ b/src/structs.h @@ -359,6 +359,7 @@ typedef struct { Entity *missionTarget; Entity *jumpgate; Entity *messageSpeaker; + Entity *lastKilledPlayer; SDL_Texture *background, *planetTexture; PointF planet; int planetWidth, planetHeight;