Codechange: add tests for GS <-> AdminPort JSON conversion (#11252)
While at it, fix a bug where booleans were made integers.
This commit is contained in:
@@ -36,7 +36,7 @@ public:
|
||||
static bool Send(void *table);
|
||||
#endif /* DOXYGEN_API */
|
||||
|
||||
private:
|
||||
protected:
|
||||
/**
|
||||
* Convert a Squirrel structure into a JSON string.
|
||||
* @param vm The VM to operate on.
|
||||
|
@@ -222,11 +222,11 @@ const char *ScriptEventAdminPort::ReadValue(HSQUIRRELVM vm, const char *p)
|
||||
SKIP_EMPTY(p);
|
||||
|
||||
if (strncmp(p, "false", 5) == 0) {
|
||||
sq_pushinteger(vm, 0);
|
||||
sq_pushbool(vm, 0);
|
||||
return p + 5;
|
||||
}
|
||||
if (strncmp(p, "true", 4) == 0) {
|
||||
sq_pushinteger(vm, 1);
|
||||
sq_pushbool(vm, 1);
|
||||
return p + 4;
|
||||
}
|
||||
if (strncmp(p, "null", 4) == 0) {
|
||||
|
@@ -44,6 +44,7 @@ typedef bool (ScriptAsyncModeProc)();
|
||||
class ScriptObject : public SimpleCountedObject {
|
||||
friend class ScriptInstance;
|
||||
friend class ScriptController;
|
||||
friend class TestScriptController;
|
||||
protected:
|
||||
/**
|
||||
* A class that handles the current active instance. By instantiating it at
|
||||
|
Reference in New Issue
Block a user