X3:FL - Bug in Script !lib.player.lockstation

Ask here if you experience technical problems with X³: Terran Conflict, X³: Albion Prelude or X³: Farnham's Legacy.

Moderators: timon37, Moderators for English X Forum

Post Reply
User avatar
Deadly_Shadow
Posts: 61
Joined: Thu, 13. May 04, 17:44
x3

X3:FL - Bug in Script !lib.player.lockstation

Post by Deadly_Shadow » Tue, 25. May 21, 01:11

Just stumbled about that while scripting around.
Is there some bug reporting mechanism I don't know about yet?
Consequence of this bug is, that a ship trying to release all of its own locks at once (a.station==null or a.ware==null), instead releases all locks existing.

Code: Select all

[...]
   sub.RemoveAllWares:
   $next.ware = get next key: table=$lock.station key=null
   while $next.ware
     $ware = $next.ware
     $next.ware = get next key: table=$lock.station key=$next.ware
-    $lock.ship = $lock.station[$ware]
+    $lock.array = $lock.station[$ware]
+    $lock.ship = $lock.array[0]
     if $lock.ship != [THIS]
       do if $lock.ship -> exists
         continue
     end
     remove key $ware from table $lock.station
   end
   endsub
[...]

User avatar
Deadly_Shadow
Posts: 61
Joined: Thu, 13. May 04, 17:44
x3

Re: X3:FL - Bug in Script !lib.player.lockstation

Post by Deadly_Shadow » Tue, 25. May 21, 01:24

P.S.: Shouldn't there also be a check within the if $a.remove block?

Code: Select all

[...]
   if $a.remove
[...]
           if not $a.ware
             gosub sub.RemoveAllWares
           else
-            remove key $a.ware from table $lock.station
+            $lock.array = $lock.station[$a.ware]
+            $lock.ship = $lock.array[0]
+            do if $lock.ship == [THIS]
+              remove key $a.ware from table $lock.station
           end
[...]

Post Reply

Return to “X³: Terran Conflict / Albion Prelude / Farnham's Legacy - Technical Support”