keybind fixes/cleanups

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6628 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2011-08-31 17:48:23 +00:00
parent ee624d8dc0
commit 9aa3585477
+3 -4
View File
@@ -180,15 +180,14 @@ vector<keym> keyms;
const char *keycmds[keym::NUMACTIONS] = { "bind", "specbind", "editbind" };
inline const char *keycmd(int type) { return type >= 0 && type < keym::NUMACTIONS ? keycmds[type] : ""; }
void keymap(char *code, char *key, char *action)
void keymap(char *code, char *key)
{
keym &km = keyms.add();
km.code = atoi(code);
km.name = newstring(key);
// km.action = newstring(action);
}
COMMAND(keymap, ARG_3STR);
COMMAND(keymap, ARG_2STR);
keym *findbind(const char *key)
{
@@ -564,7 +563,7 @@ void writebinds(stream *f)
loopv(keyms)
{
keym *km = &keyms[i];
loopj(3) if(km->actions[j]) f->printf("%s \"%s\" [%s]\n", keycmd(j), km->name, km->actions[j]);
loopj(3) if(*km->actions[j]) f->printf("%s \"%s\" [%s]\n", keycmd(j), km->name, km->actions[j]);
}
}