cleanup
This commit is contained in:
@ -427,7 +427,7 @@ namespace gsc
|
||||
const auto what = args[0].get_raw();
|
||||
const auto with = args[1].get_raw();
|
||||
|
||||
if (what.type != game::SCRIPT_FUNCTION || with.type != game::SCRIPT_FUNCTION)
|
||||
if (what.type != game::VAR_FUNCTION || with.type != game::VAR_FUNCTION)
|
||||
{
|
||||
throw std::runtime_error("replaceFunc: parameter 1 must be a function");
|
||||
}
|
||||
|
@ -66,32 +66,32 @@ namespace json
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case (game::SCRIPT_NONE):
|
||||
case (game::VAR_UNDEFINED):
|
||||
return {};
|
||||
case (game::SCRIPT_INTEGER):
|
||||
case (game::VAR_INTEGER):
|
||||
return value.intValue;
|
||||
case (game::SCRIPT_FLOAT):
|
||||
case (game::VAR_FLOAT):
|
||||
return value.floatValue;
|
||||
case (game::SCRIPT_STRING):
|
||||
case (game::SCRIPT_ISTRING):
|
||||
case (game::VAR_STRING):
|
||||
case (game::VAR_ISTRING):
|
||||
return game::SL_ConvertToString(static_cast<game::scr_string_t>(value.stringValue));
|
||||
case (game::SCRIPT_VECTOR):
|
||||
case (game::VAR_VECTOR):
|
||||
return vector_to_array(value.vectorValue);
|
||||
case (game::SCRIPT_OBJECT):
|
||||
case (game::VAR_POINTER):
|
||||
{
|
||||
const auto object_type = game::scr_VarGlob->objectVariableValue[value.uintValue].w.type;
|
||||
|
||||
switch (object_type)
|
||||
{
|
||||
case (game::SCRIPT_STRUCT):
|
||||
case (game::VAR_OBJECT):
|
||||
return "[struct]";
|
||||
case (game::SCRIPT_ARRAY):
|
||||
case (game::VAR_ARRAY):
|
||||
return entity_to_array(value.uintValue);
|
||||
default:
|
||||
return "[entity]";
|
||||
}
|
||||
}
|
||||
case (game::SCRIPT_FUNCTION):
|
||||
case (game::VAR_FUNCTION):
|
||||
return _value.as<scripting::function>().get_name();
|
||||
default:
|
||||
return utils::string::va("[%s]", _value.type_name().data());
|
||||
|
@ -196,7 +196,7 @@ namespace logfile
|
||||
|
||||
const auto top = game::scr_function_stack->top;
|
||||
|
||||
for (auto* value = top; value->type != game::SCRIPT_END; --value)
|
||||
for (auto* value = top; value->type != game::VAR_PRECODEPOS; --value)
|
||||
{
|
||||
args.push_back(scripting::lua::convert(state, *value));
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ namespace scripting
|
||||
e.name = string;
|
||||
e.entity = notify_list_owner_id;
|
||||
|
||||
for (auto* value = top; value->type != game::SCRIPT_END; --value)
|
||||
for (auto* value = top; value->type != game::VAR_PRECODEPOS; --value)
|
||||
{
|
||||
e.arguments.emplace_back(*value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user