A bit of research on mouse clicks
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
Content/Widgets/WB_Menu.uasset
LFS
BIN
Content/Widgets/WB_Menu.uasset
LFS
Binary file not shown.
@@ -394,7 +394,14 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view
|
||||
// Get the actor and place, C++ version. Make sure both exist.
|
||||
Tangible *tactor = tangible_get(actor_id);
|
||||
Tangible *tplace = tangible_get(place_id);
|
||||
if ((tactor == nullptr) || (tplace == nullptr)) {
|
||||
if (tactor == nullptr) {
|
||||
retvals->write_lua_value_type(LuaValueType::STRING);
|
||||
retvals->write_string("no such actor tangible");
|
||||
return;
|
||||
}
|
||||
if (tplace == nullptr) {
|
||||
retvals->write_lua_value_type(LuaValueType::STRING);
|
||||
retvals->write_string("no such place tangible");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -408,6 +415,8 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view
|
||||
classname = datasb.read_string_limit(100);
|
||||
funcname = datasb.read_string_limit(100);
|
||||
} catch (const StreamException &ex) {
|
||||
retvals->write_lua_value_type(LuaValueType::STRING);
|
||||
retvals->write_string("datapack passed to probe_lua_call was corrupted");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -419,6 +428,8 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view
|
||||
LS.rawget(actor, tangibles, actor_id);
|
||||
LS.rawget(place, tangibles, place_id);
|
||||
if (!LS.istable(actor) || !LS.istable(place)) {
|
||||
retvals->write_lua_value_type(LuaValueType::STRING);
|
||||
retvals->write_string("probe_lua_call failed to properly look up actor or place");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -433,11 +444,19 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view
|
||||
|
||||
// Get the true classname. This also checks validity of the class.
|
||||
classname = LS.classname(lclass);
|
||||
if (classname.empty()) return;
|
||||
if (classname.empty()) {
|
||||
retvals->write_lua_value_type(LuaValueType::STRING);
|
||||
retvals->write_string("classname is not a valid class");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the function from the class.
|
||||
LS.rawget(lfunc, lclass, funcname);
|
||||
if (!LS.isfunction(lfunc)) return;
|
||||
if (!LS.isfunction(lfunc)) {
|
||||
retvals->write_lua_value_type(LuaValueType::STRING);
|
||||
retvals->write_string("function does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
// Call the closure.
|
||||
int calltop = lua_gettop(L);
|
||||
@@ -449,6 +468,8 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view
|
||||
nargs++;
|
||||
}
|
||||
} catch (const StreamException &exc) {
|
||||
retvals->write_lua_value_type(LuaValueType::STRING);
|
||||
retvals->write_string("could not pass parameters to lua (bug)");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
|
||||
ut-table.lua
|
||||
hotkeys.lua
|
||||
menu.lua
|
||||
login.lua
|
||||
|
||||
Reference in New Issue
Block a user