Permalink
Browse files

* player.teleport() should now behave exactly like jumping.

  • Loading branch information...
bobbens committed Feb 1, 2010
1 parent 8523f2d commit 79de1a4a6415de12b752e74f3f8d903c6b99619d
Showing with 13 additions and 4 deletions.
  1. +13 −4 src/nlua_player.c
View
@@ -527,16 +527,25 @@ static int playerL_teleport( lua_State *L )
/* Get a system. */
sys = luaL_checksystem(L,1);
+ /* Jump out hook is run first. */
+ hooks_run( "jumpout" );
+
+ /* Just in case remove hyperspace flags. */
+ pilot_rmFlag( player, PILOT_HYPERSPACE | PILOT_HYP_BEGIN | PILOT_HYP_PREP );
+
/* Go to the new system. */
space_init( sys->s->name );
+ /* Map gets deformed when jumping this way. */
+ map_clear();
+
+ /* Add the escorts. */
+ player_addEscorts();
+
/* Run hooks - order is important. */
- hooks_run( "jumpout" );
hooks_run( "jumpin" );
hooks_run( "enter" );
-
- /* Map gets deformed when jumping this way. */
- map_clear();
+ events_trigger( EVENT_TRIGGER_ENTER );
return 0;
}

0 comments on commit 79de1a4

Please sign in to comment.