待辦事項 #43584

edit.remove_extra() causing assert failures

啟用日期: 2022-01-08 14:08 最後更新: 2022-02-05 05:09

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
1

細節

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 History (3/6 Histories)

2022-01-08 14:08 Updated by: ddeanbrown
  • New Ticket "edit.remove_extra() causing assert failures" created
2022-01-08 14:42 Updated by: cazfi
  • 處理結果 Update from to Accepted
  • 里程碑 Update from (無) to 3.0.0 (closed)
評語

Will push this fix even to S2_6.

2022-01-21 11:57 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from Accepted to 修正
2022-02-05 04:43 Updated by: ddeanbrown
評語

Tested with RC1, assert errors are gone, but remove_extra() is not working.

Also tried connecting to "turn_begin" signal and running on turn 1, instead of connecting to "map_generated" signal, and saw same problem, so maybe remove_extra() got broken.

2022-02-05 05:09 Updated by: cazfi
評語

Reply To ddeanbrown

but remove_extra() is not working.

Opened a new ticket about it (this one has been closed, and even documented fixed in RC1) -> #43782

編輯

Please login to add comment to this ticket » 登入