[Freeciv-tickets] [freeciv] #43584: edit.remove_extra() causing assert failures

Back to archive index
OSDN Ticket System norep****@osdn*****
Fri Jan 21 11:57:09 JST 2022


#43584: edit.remove_extra() causing assert failures

  Open Date: 2022-01-08 07:08
Last Update: 2022-01-21 04:57

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/43584
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=43584

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-01-21 04:57 Updated by: cazfi
 * Status Update from Open to Closed
 * Owner Update from (None) to cazfi
 * Resolution Update from Accepted to Fixed


---------------------------------------------------------------------
Ticket Status:

      Reporter: ddeanbrown
         Owner: cazfi
          Type: Bugs
        Status: Closed
      Priority: 5 - Medium
     MileStone: 3.0.0
     Component: Scripting API
      Severity: 5 - Medium
    Resolution: Fixed
---------------------------------------------------------------------

Ticket details:

3.0.0-beta2
For context, see this forum topic - http://forum.freeciv.org/f/viewtopic.php?f=13&t=92129
Using the sandbox ruleset, add this to script.lua
function coast_only(tile, resource)
  isOK = false
  for t in tile:square_iterate(1) do
    class = t.terrain:class_name()
    if class == "Oceanic" then
      isOK = true
      break;
    end
  end -- for tile:square_iterate
  if not isOK then
    edit.remove_extra(tile, resource)
  end
end

function coasts_only_callback()
  for tile in whole_map_iterate() do
    local resource = "Ivory"
    if tile:has_extra(resource) then
      coast_only(tile, resource)
    end
  end -- for whole_map_iterate
  return false
end

signal.connect("map_generated", "coasts_only_callback")
When run, chat log shows this many times
in dbv_isset() [../../freeciv-3.0.0/utility/bitvector.c::122]: assertion 'pdbv->vec != ((void*)0)' failed.
Please report this message at https://osdn.net/projects/freeciv/ticket/
Without edit.remove_extra(tile, resource) the problem doesn't happen.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/43584
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=43584



More information about the Freeciv-tickets mailing list
Back to archive index