crosshair: prevent crash from command usage in headless mode
This commit is contained in:
parent
1f5e6e6b4d
commit
3f1747b1fb
|
|
@ -3819,7 +3819,8 @@ CmdCrosshair(
|
||||||
TxError("Usage: %s off|x y \n", cmd->tx_argv[0]);
|
TxError("Usage: %s off|x y \n", cmd->tx_argv[0]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DBWSetCrosshair(w, &pos);
|
if (w)
|
||||||
|
DBWSetCrosshair(w, &pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -558,6 +558,9 @@ DBWSetCrosshair(window, pos)
|
||||||
MagWindow *window;
|
MagWindow *window;
|
||||||
Point *pos; /* New crosshair location in coords of rootDef. */
|
Point *pos; /* New crosshair location in coords of rootDef. */
|
||||||
{
|
{
|
||||||
|
assert(window);
|
||||||
|
assert(pos);
|
||||||
|
|
||||||
bool needUpdate = FALSE;
|
bool needUpdate = FALSE;
|
||||||
|
|
||||||
if (WINDOW_DEF(window) != curCrosshair.def) needUpdate = TRUE;
|
if (WINDOW_DEF(window) != curCrosshair.def) needUpdate = TRUE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue