[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:
parent
36d7f1c3f8
commit
e224366ce6
@ -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;
|
||||
|
@ -1895,7 +1895,6 @@ void player_brokeHyperspace(void) {
|
||||
}
|
||||
|
||||
/* Run the jump hooks. */
|
||||
hooks_run("jump");
|
||||
hooks_run("enter");
|
||||
|
||||
player_message("BANG!");
|
||||
|
Loading…
Reference in New Issue
Block a user