URL:
  <http://gna.org/bugs/?22341>

                 Summary: Lua script calling has_base crashes freeciv
                 Project: Freeciv
            Submitted by: timehorse
            Submitted on: Mon 14 Jul 2014 09:41:57 PM UTC
                Category: general
                Severity: 5 - Blocker
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: SVN@25382
         Discussion Lock: Any
        Operating System: GNU/Linux
         Planned Release: 

    _______________________________________________________

Details:

The following lua script causes Freeciv to crash and core dump:

Karchidons = 0
Pfree = 0
for v in find.player(0):units_iterate() do
    if v.utype.id == 11 then
        local m = getmetatable(v)
    elseif v.utype.id == 9 then
        t = v.tile
        if t then
            c = t:city()
            if c then
                if c.id == 8715 then
                    Karchidons = Karchidons + 1
                else
                    log.debug(c.name .. " " .. c.id)
                end
            else
                log.debug(v.utype:rule_name())
                if t:has_base(v.utype:rule_name()) then -- This is the line
that causes the game to crash
                    log.debug("Partisan stationed at (" .. t.x .. ", " .. t.y
.. ")")
                else
                    log.debug("Partisan at (" .. t.x .. ", " .. t.y .. ")")
                end
                Pfree = Pfree + 1
            end
        end
    end
end
log.debug(Karchidons .. " Partisans in Karchidons.")
log.debug(Pfree .. " Partisan Free Agents.")




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?22341>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to