From da4b261de7d875f1d64303c2eaf2b5155e79cedc Mon Sep 17 00:00:00 2001 From: Allanis Date: Fri, 6 Dec 2013 20:59:24 +0000 Subject: [PATCH] [Change] Stop firing before starting to jump into hyperspace. --- dat/missions/emp_collective05.lua | 4 ---- src/ai.c | 2 ++ src/pilot.c | 4 ++-- src/player.c | 5 ++++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dat/missions/emp_collective05.lua b/dat/missions/emp_collective05.lua index c6641a6..80f86a9 100644 --- a/dat/missions/emp_collective05.lua +++ b/dat/missions/emp_collective05.lua @@ -174,10 +174,6 @@ function final_talk() -- ESS Trinity becomes collective now. trinity:setFaction("Collective") - -- Some music. - music.load("galacticbattle") - music.play() - final_fight = 3 misn.timerStart("final_talk", rnd.int(4000, 5000)) else if final_fight == 3 then diff --git a/src/ai.c b/src/ai.c index 8b40530..bdc45b0 100644 --- a/src/ai.c +++ b/src/ai.c @@ -929,6 +929,8 @@ static int ai_getlandplanet(lua_State* L) { static int ai_hyperspace(lua_State* L) { int dist; + pilot_shootStop(cur_pilot, 0); + pilot_shootStop(cur_pilot, 1); dist = space_hyperspace(cur_pilot); if(dist == 0.) return 0; diff --git a/src/pilot.c b/src/pilot.c index 6eb4f39..8a135a3 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -245,9 +245,9 @@ void pilot_shootStop(Pilot* p, const int secondary) { } } } else { /* Secondary weapons. */ - o = p->secondary->outfit; + if(p->secondary == NULL) return; /* No secondary weapon. */ - if(o == NULL) return; /* No secondary weapon. */ + o = p->secondary->outfit; if(outfit_isBeam(o) && (p->secondary->beamid > 0)) { beam_end(p->id, p->secondary->beamid); diff --git a/src/player.c b/src/player.c index 4a8a4c7..b0943f5 100644 --- a/src/player.c +++ b/src/player.c @@ -1728,8 +1728,11 @@ void player_jump(void) { player_message("You are moving too fast to enter hyperspace."); else if(i == -3) player_message("You do not have enough fuel to hyperspace jump."); - else + else { player_message("Preparing for hyperspace."); + pilot_shootStop(player, 0); + pilot_shootStop(player, 1); + } } /**