Fix segfault when binding keys in-game
This commit is contained in:
@@ -2297,7 +2297,6 @@ handler_rebind_keys_add(boolean keyfirst)
|
|||||||
char buf2[QBUFSZ];
|
char buf2[QBUFSZ];
|
||||||
uchar key = '\0';
|
uchar key = '\0';
|
||||||
int clr = NO_COLOR;
|
int clr = NO_COLOR;
|
||||||
struct Cmd_bind *bind;
|
|
||||||
|
|
||||||
if (keyfirst) {
|
if (keyfirst) {
|
||||||
pline("Bind which key? ");
|
pline("Bind which key? ");
|
||||||
@@ -2312,8 +2311,9 @@ handler_rebind_keys_add(boolean keyfirst)
|
|||||||
any = cg.zeroany;
|
any = cg.zeroany;
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
bind = cmdbind_get(key);
|
struct Cmd_bind *bind = cmdbind_get(key);
|
||||||
if (bind) {
|
|
||||||
|
if (bind && bind->cmd) {
|
||||||
Sprintf(buf, "Key '%s' is currently bound to \"%s\".",
|
Sprintf(buf, "Key '%s' is currently bound to \"%s\".",
|
||||||
key2txt(key, buf2), bind->cmd->ef_txt);
|
key2txt(key, buf2), bind->cmd->ef_txt);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user