Date: Sunday February 11, 2001 @ 18:10
Author: unbelver
Update of /home/netrek/cvsroot/Vanilla/tools
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv14220/tools
Modified Files:
xtkill.c
Log Message:
* tools/xtkill.c (main): Added bounds checking to
promote/demote. ntserv will crash if there is an invalid rank.
****************************************
Index: Vanilla/tools/xtkill.c
diff -u Vanilla/tools/xtkill.c:1.6 Vanilla/tools/xtkill.c:1.7
--- Vanilla/tools/xtkill.c:1.6 Fri Jun 23 04:12:59 2000
+++ Vanilla/tools/xtkill.c Sun Feb 11 18:10:48 2001
@@ -171,14 +171,18 @@
players[player].p_ship.s_maxdamage = 750;
players[player].p_ship.s_maxegntemp = 5000;
break;
- case 'D': /* demote */
+ case 'D': /* demote, but not beyond ensign */
+ if(players[player].p_stats.st_rank == 0)
+ players[player].p_stats.st_rank++;
+
--players[player].p_stats.st_rank;
sprintf(buf, "GOD->ALL %2s was (temporarily) demoted for rank normalization purposes.",
players[player].p_mapchars);
_pmessage(buf, 0, MALL);
break;
- case 'P': /* promote */
- ++players[player].p_stats.st_rank;
+ case 'P': /* promote, but not beyond admiral */
+ if( players[player].p_stats.st_rank < (NUMRANKS - 1) )
+ ++players[player].p_stats.st_rank;
break;
case 'k': /* kill increment */
players[player].p_kills += 1.0;