CB_KILL and CB_KILL_POST_NOTIFY

Issue #46 resolved
Justin Schwartz created an issue

typedef void (KillFunc)(Arena arena, Player killer, Player killed, int bounty, int flags, int *pts, int *green);

The CB_KILL callback type doesn't fit with the established definition of callbacks for one-way event notification. Further more the CB_KILL_POST_NOTIFY callback seems to fit more in line with what CB_KILL should actually be.

Proposal: {{{ / CB_KILL_POST_NOTIFY turns into this / #define CB_KILL "kill-3" typedef void (KillFunc)(Arena arena, Player killer, Player killed, int bounty, int flags, int pts, int green);

/ CB_KILL turns into this. / #define A_KILLS "kills-adv" typedef struct Akills { void KillPoints(Arena , Player killer, Player killed, int bounty, int pts); void KillGreen(Arena , Player killer, Player killed, int bounty, int green); } Akills;

}}}

Comments (4)

  1. Former user Account Deleted

    I agree that the points functionality should become an adviser (and the total points should then be the sum of all adviser return values).

    Greens, however, are more suited to an interface. It's hard to come up with a situation where multiple modules could play nice with setting greens.

  2. Justin Schwartz reporter

    You could always make the greens function a bit more complex to suit a priority or random change situation between two advisers' results, but since there are so few modules that want to modify the green an interface should be sufficient.

  3. Former user Account Deleted

    I've applied a modified version of Jowie's patch from #107. My modifications eliminate the backwards incompatibility from changing the kill callback, and slightly modify the return mechanism for the points adviser. This closes #46 and #107.

    → <<cset 8159ce6d03c6>>

  4. Log in to comment