This commit is contained in:
bryanthaboi
2026-10-02 14:10:22 -04:00
parent 09445ab6b8
commit 24433fecc2
3 changed files with 14 additions and 6 deletions
-4
View File
@@ -2198,10 +2198,6 @@ function Objects.hideObjectAt(localId, mapGroup, mapNum)
or (on_named_map(mapGroup, mapNum) and Objects._byId[localId] or nil)
if not eo then return false end
eo.invisible = true
eo.hidden = true
eo.visible = false
if eo.def then eo.def.hidden = true end
Objects._tracks[eo.localId] = nil
return true
end
+2 -2
View File
@@ -85,8 +85,8 @@ do
local hiddenOk = Objects.hideObjectAt(2, 0, 0)
assert(hiddenOk == true, "hideObjectAt should return true")
assert(carriedBoat.invisible == true, "carriedBoat should be invisible")
assert(carriedBoat.hidden == true, "carriedBoat should be hidden")
assert(carriedBoat.visible == false, "carriedBoat should not be visible")
assert(carriedBoat.hidden ~= true, "hideobjectat leaves the boat active")
assert(carriedBoat.visible == true, "hideobjectat does not clear visible")
-- Check forDraw: carried boat should NOT be in draw list
local drawList = Objects.forDraw()
@@ -91,6 +91,18 @@ Objects.loadMap(nil, MAP, pcDef())
Objects.addObject(6)
check(not has(Objects.forDraw(), 6), "journal 6 still not drawn")
print("[test] 9. hideobjectat stays talkable")
local nurse = Objects.find(1)
Objects.hideObjectAt(1)
check(nurse.invisible == true, "hideobjectat sets invisible")
check(nurse.visible and not nurse.hidden, "hideobjectat leaves the object active")
check(Objects.at(7, 2) == nurse, "Objects.at still finds a hideobjectat object")
check(Objects.blocks(7, 2), "hideobjectat object still occupies its tile")
check(not has(Objects.forDraw(), 1), "hideobjectat object is not drawn")
Objects.showObjectAt(1)
check(nurse.invisible ~= true, "showobjectat clears invisible")
check(has(Objects.forDraw(), 1), "showobjectat draws it again")
if failed > 0 then
print("[test] FAILED " .. failed)
os.exit(1)