From 71f3e3815b8019a5a6df6d8df89ed66bfaa5c87b Mon Sep 17 00:00:00 2001 From: Lucas GAUTHERON Date: Sat, 5 Jan 2013 22:28:52 +0000 Subject: [PATCH] save kill messages into saved.cfg instead of a separate file (client) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7030 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 17 ----------------- source/src/command.cpp | 9 +++++++++ source/src/main.cpp | 2 -- source/src/protos.h | 1 - 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index e7036374..eec5e185 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -814,34 +814,17 @@ void setkillmessage(int gun, bool gib, const char *message) result(killmessage(gun, gib)); return; } - if(gun < 0 || gun >= NUMGUNS) { conoutf("invalid gun specified"); return; } - copystring(killmessages[gib?1:0][gun], message, sizeof(killmessages[gib?1:0][gun])); } COMMANDF(fragmessage, "is", (int *gun, const char *message) { setkillmessage(*gun, false, message); }); COMMANDF(gibmessage, "is", (int *gun, const char *message) { setkillmessage(*gun, true, message); }); -void writekillmsgcfg() -{ - stream *f = openfile(path("config/killmessages.cfg", true), "w"); - if(!f) return; - f->printf("// kill messages for each weapon\n"); - loopi(NUMGUNS) - { - const char *fragmsg = killmessage(i, false); - const char *gibmsg = killmessage(i, true); - f->printf("\nfragmessage %d \"%s\"", i, fragmsg); - f->printf("\ngibmessage %d \"%s\"", i, gibmsg); - } - f->printf("\n"); -} - void burstshots(int gun, int shots) { // args are passed as strings to differentiate 2 cases : shots_str == "0" or shots_str is empty (not specified from cubescript). diff --git a/source/src/command.cpp b/source/src/command.cpp index dbc99a0f..970b0812 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -1385,6 +1385,15 @@ void writecfg() f->printf("\n"); audiomgr.writesoundconfig(f); f->printf("\n"); + f->printf("// kill messages for each weapon\n"); + loopi(NUMGUNS) + { + const char *fragmsg = killmessage(i, false); + const char *gibmsg = killmessage(i, true); + f->printf("\nfragmessage %d \"%s\"", i, fragmsg); + f->printf("\ngibmessage %d \"%s\"", i, gibmsg); + } + f->printf("\n"); enumerate(*idents, ident, id, if(!id.persist) continue; switch(id.type) diff --git a/source/src/main.cpp b/source/src/main.cpp index ae30135c..bd44a00c 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -34,7 +34,6 @@ void quit() // normal exit extern void writeinitcfg(); writeinitcfg(); writeservercfg(); - writekillmsgcfg(); if(resetcfg) deletecfg(); else writecfg(); cleanup(NULL); @@ -1155,7 +1154,6 @@ int main(int argc, char **argv) exec("config/securemaps.cfg"); exec("config/admin.cfg"); execfile("config/servers.cfg"); - execfile("config/killmessages.cfg"); persistidents = true; static char resdata[] = { 112, 97, 99, 107, 97, 103, 101, 115, 47, 116, 101, 120, 116, 117, 114, 101, 115, 47, 107, 117, 114, 116, 47, 107, 108, 105, 116, 101, 50, 46, 106, 112, 103, 0 }; diff --git a/source/src/protos.h b/source/src/protos.h index 3480edf2..c466c4b0 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -797,7 +797,6 @@ extern void push(const char *name, const char *action); extern void pop(const char *name); extern void alias(const char *name, const char *action); extern const char *getalias(const char *name); -extern void writekillmsgcfg(); extern void writecfg(); extern void deletecfg(); extern void identnames(vector &names, bool builtinonly);