Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions client/decorating.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@ function ToggleDecorating()
if cursorMode then
local entity = SelectEntityAtCursor((1 << 5), true)
if entity ~= last then
if lib.table.contains(DecorationObjects, entity) then
if lib.table.contains(DecorationObjects, entity) and DoesEntityExist(entity) then
SetEntityDrawOutline(entity, true)
end
SetEntityDrawOutline(last, false)

if DoesEntityExist(last) then
SetEntityDrawOutline(last, false)
end
last = entity
end
if IsDisabledControlJustReleased(0, 24) and previewObject ~= entity and entity ~= 0 then
Expand All @@ -122,7 +125,9 @@ function ToggleDecorating()
DeleteEntity(previewObject)
end
end
SetEntityDrawOutline(last, false)
if DoesEntityExist(last) then
SetEntityDrawOutline(last, false)
end
ToggleDecorating()
end
if IsDisabledControlJustReleased(0, 38) then
Expand All @@ -134,7 +139,9 @@ function ToggleDecorating()
if cursorMode then
EnterCursorMode()
else
SetEntityDrawOutline(last, false)
if DoesEntityExist(last) then
SetEntityDrawOutline(last, false)
end
LeaveCursorMode()
end
end
Expand Down
Loading