[Freeciv-tickets] [freeciv] #57670: 3.1: no LUA signals for some actions

アーカイブの一覧に戻る
OSDN Ticket System norep****@osdn*****
Sat May 4 19:08:47 JST 2024


#57670: 3.1: no LUA signals for some actions

  Open Date: 2024-04-15 23:15
Last Update: 2024-05-04 13:08

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

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

Last Changes/Comment on this Ticket:
2024-05-04 13:08 Updated by: cazfi

Comment:

Reply To bard
I didn't plan to report the following because I thought it was caused by a bad use of the scripts, but just in case it could be related to this bug...

When I use a LUA script, triggered by a finished action signal, and the script kills the actor or forces him to disband (I tested different action triggers and different ways to kill the actor), then if the actor unit is being transported, there is a crash with the error:

in utype_can_do_action() [unittype.c::449]: assertion '(signed int)(utype_index(putype)) >= 0 && (signed int)(utype_index(putype)) < (signed int) sizeof((unit_can_act_cacheact_id).vec) * 8' failed.

The script:
{{{
function action_finished_callback(action, success, actor, target)
  if action:rule_name() == "Heal Unit" then
    if success then
      -- FIXME: this crashes when healer is being transported
      actor:kill("used",Nil)
    end
  end
end
}}}
I could not reproduce this. Please open a new ticket if you still can reproduce it yourself.

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

      Reporter: bard
         Owner: cazfi
          Type: Bugs
        Status: Open [Owner assigned]
      Priority: 5 - Medium
     MileStone: 3.1.2
     Component: Server
      Severity: 5 - Medium
    Resolution: Accepted
---------------------------------------------------------------------

Ticket details:

There are no LUA signals in 3.1 for the actions: Pillage, Fortify, and Convert Unit.
I don't know if this is intended, or a bug. I can't compile and test the trunk right now to see if they work there.
I mean that this LUA script will never be triggered: 
function action_started_callback(action, actor, target)
  if action:rule_name() == "Fortify" then
    --never triggered...
  elseif action:rule_name() == "Pillage" then
    --never triggered...
  end
end

signal.connect("action_started_unit_self", "action_started_callback")
signal.connect("action_started_unit_tile", "action_started_callback")


-- 
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/57670
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=57670



More information about the Freeciv-tickets mailing list
アーカイブの一覧に戻る