28 lines
1.2 KiB
Lua
28 lines
1.2 KiB
Lua
local ourIndex = tonumber(matches[2])
|
|
|
|
if Bashmatic.enemies.group then
|
|
local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil
|
|
if area == nil then
|
|
cecho("\n<firebrick>Bashmatic: Attempted to clear area targets but got a bad area.\nGot: " .. area .. "<reset>")
|
|
return
|
|
end
|
|
if not table.contains(Bashmatic.enemies.targets, area) then
|
|
cecho("\n<firebrick>Bashmatic: You don't have any enemies for the area " .. area .. "<reset>")
|
|
return
|
|
end
|
|
local size = table.size(Bashmatic.enemies.targets.area)
|
|
if ourIndex > size then
|
|
cecho("\n<firebrick>Bashmatic: Index out of range for this area. There are only " .. size .. " targets stored.<reset>")
|
|
return
|
|
end
|
|
table.remove(Bashmatic.enemies.targets.area, ourIndex)
|
|
cecho("\n<DarkSlateBlue>Bashmatic: Removed target from the area list.<reset>")
|
|
else
|
|
local size = table.size(Bashmatic.enemies.targets)
|
|
if ourIndex > size then
|
|
cecho("\n<firebrick>Bashmatic: Index out of range. There are only " .. size .. " targets stored.<reset>")
|
|
return
|
|
end
|
|
table.remove(Bashmatic.enemies.targets, ourIndex)
|
|
cecho("\n<DarkSlateBlue>Bashmatic: Removed target from the list.<reset>")
|
|
end |