mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- fixed: SafeCommand did not work anymore because it failed the abuse prevention check for DoCommand.
This commit is contained in:
parent
224219dd66
commit
d5772ff895
1 changed files with 8 additions and 5 deletions
|
@ -132,11 +132,14 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
|
||||||
override bool Activate()
|
override bool Activate()
|
||||||
{
|
{
|
||||||
// This needs to perform a few checks to prevent abuse by malicious modders.
|
// This needs to perform a few checks to prevent abuse by malicious modders.
|
||||||
|
if (GetClass() != "OptionMenuItemSafeCommand")
|
||||||
|
{
|
||||||
let m = OptionMenu(Menu.GetCurrentMenu());
|
let m = OptionMenu(Menu.GetCurrentMenu());
|
||||||
// don't execute if no menu is active
|
// don't execute if no menu is active
|
||||||
if (m == null) return false;
|
if (m == null) return false;
|
||||||
// don't execute if this item cannot be found in the current menu.
|
// don't execute if this item cannot be found in the current menu.
|
||||||
if (m.GetItem(mAction) != self) return false;
|
if (m.GetItem(mAction) != self) return false;
|
||||||
|
}
|
||||||
Menu.MenuSound("menu/choose");
|
Menu.MenuSound("menu/choose");
|
||||||
DoCommand(mAction);
|
DoCommand(mAction);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue