[Add] Clean up pilot hooks when freeing pilot.

[Remove] Removed unused jump hook for player that collided with pilot
hook.
This commit is contained in:
Allanis 2014-03-07 19:49:13 +00:00
parent 36d7f1c3f8
commit e224366ce6
2 changed files with 8 additions and 1 deletions

View File

@ -1474,6 +1474,14 @@ Pilot* pilot_copy(Pilot* src) {
* @param p Pilot to free.
*/
void pilot_free(Pilot* p) {
int i;
/* Clear up pilot hooks. */
for(i = 0; i < PILOT_HOOKS; i++)
if(p->hook_type[i] != PILOT_HOOK_NONE)
hook_rm(p->hook[i]);
/* Clean up data. */
if(p->ai != NULL)
ai_destroy(p); /* Must be destroyed first if applicable. */
if(player == p) player = NULL;

View File

@ -1895,7 +1895,6 @@ void player_brokeHyperspace(void) {
}
/* Run the jump hooks. */
hooks_run("jump");
hooks_run("enter");
player_message("BANG!");