From 7a6f27da431223b57ff06eaa737d61cb948e6602 Mon Sep 17 00:00:00 2001 From: Allanis Date: Tue, 9 Jul 2013 19:03:03 +0100 Subject: [PATCH] [Add] Warn the player when a missile is locked onto her. --- src/pilot.c | 1 + src/player.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/pilot.c b/src/pilot.c index 4b0f991..46d1e25 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -878,6 +878,7 @@ void pilot_init(Pilot* pilot, Ship* ship, char* name, int faction, pilot->ai = ai; pilot->tcontrol = 0; pilot->flags = 0; + pilot->lockons = 0; /* Solid. */ pilot->solid = solid_create(ship->mass, dir, pos, vel); diff --git a/src/player.c b/src/player.c index 6fc7cf5..718b686 100644 --- a/src/player.c +++ b/src/player.c @@ -622,6 +622,11 @@ void player_render(void) { /* Render the player. */ pilot_render(player); + /* Lockon warning. */ + if(player->lockons > 0) + gl_printMid(NULL, SCREEN_W, 0., SCREEN_H-gl_defFont.h-25., + &cRed, "LOCKON DETECTED"); + /* GUI! */ /* -- Frame. */ gl_blitStatic(gui.gfx_frame, gui.frame.x, gui.frame.y, NULL);