From dcd46bbec98895e555261cf2a11e2db65d7e6425 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Tue, 22 Apr 2014 11:42:11 +0200 Subject: [PATCH] fix modifyvar give a proper error message when trying to edit read-only vars --- source/src/command.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/src/command.cpp b/source/src/command.cpp index 1f107d57..2f220502 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -223,6 +223,7 @@ void modifyvar(const char *name, int arg, char op) scripterr(); return; } + if((id->type == ID_VAR && id->minval > id->maxval) || (id->type == ID_FVAR && id->minvalf > id->maxvalf)) { conoutf("variable %s is read-only", id->name); return; } int val = 0; switch(id->type) { @@ -259,6 +260,7 @@ void modifyfvar(const char *name, float arg, char op) scripterr(); return; } + if((id->type == ID_VAR && id->minval > id->maxval) || (id->type == ID_FVAR && id->minvalf > id->maxvalf)) { conoutf("variable %s is read-only", id->name); return; } float val = 0; switch(id->type) {