ctf_Handle_Throw(frag_target, NULL, DROP_THROW);
}
+MUTATOR_HOOKFUNCTION(ctf, LogDeath_AppendItemCodes)
+{
+ entity player = M_ARGV(0, entity);
+ if(player.flagcarried)
+ M_ARGV(1, string) = strcat(M_ARGV(1, string), "F"); // item codes
+}
+
// ==========
// Spawnfuncs
return 0;
}
-//entity kh_worldkeylist;
-.entity kh_worldkeynext;
entity kh_controller;
//bool kh_tracking_enabled;
int kh_teams;
return true;
}
+MUTATOR_HOOKFUNCTION(kh, LogDeath_AppendItemCodes)
+{
+ entity player = M_ARGV(0, entity);
+ if(player.kh_next)
+ M_ARGV(1, string) = strcat(M_ARGV(1, string), "K"); // item codes
+}
+
MUTATOR_HOOKFUNCTION(kh, DropSpecialItems)
{
entity frag_target = M_ARGV(0, entity);
return 0;
}
+entity kh_worldkeylist;
+.entity kh_worldkeynext;
+
#define FOR_EACH_KH_KEY(v) for(v = kh_worldkeylist; v; v = v.kh_worldkeynext )
// ALL OF THESE should be removed in the future, as other code should not have to care
const int WAYPOINTFLAG_LADDER = BIT(15);
const int WAYPOINTFLAG_JUMP = BIT(14);
-entity kh_worldkeylist;
-.entity kh_worldkeynext;
-
float bot_custom_weapon;
float bot_weapons_close[Weapons_MAX];
float bot_weapons_far[Weapons_MAX];
UpdateFrags(attacker, f);
}
-.entity kh_next;
-
string AppendItemcodes(string s, entity player)
{
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
s = strcat(s, "S");
if(time < player.invincible_finished)
s = strcat(s, "I");
- if(player.flagcarried != NULL)
- s = strcat(s, "F");
if(PHYS_INPUT_BUTTON_CHAT(player))
s = strcat(s, "T");
- if(player.kh_next)
- s = strcat(s, "K");
+ // TODO: include these codes as a flag on the item itself
+ MUTATOR_CALLHOOK(LogDeath_AppendItemCodes, player, s);
+ s = M_ARGV(1, string);
return s;
}
/**/ o(int, MUTATOR_ARGV_0_int) \
/**/
MUTATOR_HOOKABLE(GetPlayerLimit, EV_GetPlayerLimit);
+
+/** include special item codes for a death to the game log */
+#define EV_LogDeath_AppendItemCodes(i, o) \
+ /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** item codes */ i(string, MUTATOR_ARGV_1_string) \
+ /**/ o(string, MUTATOR_ARGV_1_string) \
+ /**/
+MUTATOR_HOOKABLE(LogDeath_AppendItemCodes, EV_LogDeath_AppendItemCodes);