Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

player.replaceShip doesn't discard old ship's cargo

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

player.replaceShip doesn't discard old ship's cargo

Post by dybal »

The wiki says that replaceShip discards the player current ship, including all cargo, passenger contracts and equipment.

Well, it doesn't, at least the cargo... I switched ships using HyperSpaceHangar (my version doesn't discard the cargo hold before calling ShipStorageHelper), the ship I switched into had empty cargo hold when stored (I checked that, my version of ShipStorageHeper logs the ships in both store and restore), after restore it had the same content as the previous ship...

From the Latest.log:

Previous Ship Stored Array (Cargo Hold is position 8 ):

Code: Select all

00:39:25.170 [Ship_Storage_Helper.js]: 0: [0,20,180162138956.9095,"Terrapin: Terrania","Retila",["sfep_pa
g_coriolis1","sfep_PAGroove_Greenline_coriolis",{"x":1876662.25,"y":-3000953.5,"z":79247.3984375}],595796
,"Terrapin","Terrania",0,null,0,[0.699999988079071,0.8999999761581421,1,0.8999999761581421],0,1.299999952
3162842,1.2999999523162842,2.299999952316284,48,48,410,320,13,39,0.25,7,null,15,null,null,384,384,3,384,3
84,3,0,"EQ_TELESCOPE","EQ_SC_MANUAL_CONFIGURATOR_INTERNAL"]
00:39:25.170 [Ship_Storage_Helper.js]: 1: "terrapin-player"
00:39:25.170 [Ship_Storage_Helper.js]: 2: "EQ_WEAPON_RIMMERACE_LASER"
00:39:25.170 [Ship_Storage_Helper.js]: 3: "EQ_WEAPON_RIMMERACE_LASER"
00:39:25.171 [Ship_Storage_Helper.js]: 4: "EQ_WEAPON_RIMMERACE_LASER"
00:39:25.171 [Ship_Storage_Helper.js]: 5: "EQ_WEAPON_RIMMERACE_LASER"
00:39:25.171 [Ship_Storage_Helper.js]: 6: ["EQ_RMB_INTERCEPT_MISSILE","EQ_KW_JIDA_MISSILE","EQ_KW_JIDA_MI
SSILE","EQ_TUGDRONE_MISSILE","EQ_TUGDRONE_MISSILE","EQ_QC_MINE"]
00:39:25.171 [Ship_Storage_Helper.js]: 7: [["EQ_XENONHUD_VIEWMODE","EQUIPMENT_OK"],<SNIP>,["EQ_ADVANCED_SYSTEM_DATA_MFD","EQUIPMENT_OK"]]
00:39:25.171 [Ship_Storage_Helper.js]: 8: [{"containers":0,"unit":"g","displayName":"Gem-Stones","quantity":24,"commodity":"gem_stones"},{"containers":0,"unit":"kg","displayName":"Platinum","quantity":499,"commodity":"platinum"},{"containers":0,"unit":"kg","displayName":"Gold","quantity":499,"commodity":"gold"}]
00:39:25.171 [Ship_Storage_Helper.js]: 9: 6.1000000000000005
00:39:25.171 [Ship_Storage_Helper.js]: 10: []
00:39:25.171 [Ship_Storage_Helper.js]: 11: []
00:39:25.171 [Ship_Storage_Helper.js]: 12: 100
00:39:25.171 [Ship_Storage_Helper.js]: 13: 32440
00:39:25.171 [Ship_Storage_Helper.js]: 14: {"usable":1,"mass":327268.75,"x":118.7674331665039,"y":19.118560791015625,"z":124.44685363769531}
00:39:25.171 [Ship_Storage_Helper.js]: 15: "2|/////////////"
00:39:25.171 [Ship_Storage_Helper.js]: 16: ["0:0:0:0:0:0:0:36:0:0:0:0:0:0:876:1035:",null,0.01,"[\"food\",\"textiles\",\"radioactives\",\"slaves\",\"liquor_wines\",\"luxuries\",\"narcotics\",\"computers\",\"machinery\",\"alloys\",\"firearms\",\"furs\",\"minerals\",\"alien_items\",\"platinum\",\"gold\"]","[0,0,0,0,0,0,0,36,0,0,0,0,0,0,1,2]","[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[[127,660]],[[11,363],[16,331],[3,321],[127,358]]]"]
00:39:25.171 [Ship_Storage_Helper.js]: 17: null
00:39:25.171 [Ship_Storage_Helper.js]: 18: null
00:39:25.171 [Ship_Storage_Helper.js]: 19: [100,1]
00:39:25.171 [Ship_Storage_Helper.js]: 20: null
00:39:25.171 [Ship_Storage_Helper.js]: 21: null
00:39:25.171 [Ship_Storage_Helper.js]: 22: null
00:39:25.171 [Ship_Storage_Helper.js]: 23: null
00:39:25.172 [Ship_Storage_Helper.js]: 24: null
00:39:25.172 [Ship_Storage_Helper.js]: 25: null
00:39:25.172 [Ship_Storage_Helper.js]: 26: "OK"
00:39:25.172 [Ship_Storage_Helper.js]: 27: null
00:39:25.172 [Ship_Storage_Helper.js]: 28: {"json":"{\"sc\":{\"threshold\":75,\"cycler_mask\":15,\"functional\":100,\"version\":2,\"manual_version\":2,\"current_configuration\":3,\"current_cycle_position\":1,\"start_configuration\":3},\"general\":{\"disabled\":false,\"sc_disabled\":false,\"savegame_version\":0}}","enc":"ec475c16379fb9bc9e3f6535fc9d98a2050c9a4b5cec1737364434bcf8abb070e7f882212d08720b34f438345b97d561ab3f1ea3b45eb465f9840489f4434421237a937a8738553a1eccc176479d857eac35c65396f152e71e2bcca967b314a6b02573ffd8210257f2e19cf2ba9b97ff8c4e6a2e058e9ed5fd9e2b1aae743fd450ca811b1ab30f07a41c4ae51c67e9b626cbbe95d43500bf21cbc4083107c6a51718228a30ae2b0cd15481fbfefec03e1935f8546a6d74742af241845d96d1da212ae577969c4c70b15aec8e3f94cdb4c09e02c4065ae39a133002cf6ca2aee6baa715b455cfb7fc5a256603b56839"}
00:39:25.172 [Ship_Storage_Helper.js]: 29: ""
00:39:25.172 [Ship_Storage_Helper.js]: 30: ""
00:39:25.172 [Ship_Storage_Helper.js]: 31: ""
00:39:25.172 [Ship_Storage_Helper.js]: 32: ""
00:39:25.172 [Ship_Storage_Helper.js]: 33: ""
00:39:25.172 [Ship_Storage_Helper.js]: 34: 7
00:39:25.172 [Ship_Storage_Helper.js]: 35: null
00:39:25.172 [Ship_Storage_Helper.js]: 36: 50
Ship being restored (Cargo Hold at position 8 ):

Code: Select all

00:39:25.173 [Ship_Storage_Helper.js]: 0: [0,20,180162137133.0787,"Secretarybird: Secretina","Retila",["s
fep_pag_coriolis1","sfep_PAGroove_Greenline_coriolis",{"x":1876662.25,"y":-3000953.5,"z":79247.3984375}],
813007,"Secretarybird","Secretina",0,null,0,[0.699999988079071,0.8999999761581421,1,0.8999999761581421],0
,1.899999976158142,1.899999976158142,2.700000047683716,45,45,405,400,13,22,0.25,7,null,15,null,null,384,3
84,6.150000095367432,384,384,6.150000095367432,0,"EQ_TELESCOPE","EQ_SC_MANUAL_CONFIGURATOR_INTERNAL"]
00:39:25.173 [Ship_Storage_Helper.js]: 1: "secretarybird-player-elite"
00:39:25.173 [Ship_Storage_Helper.js]: 2: "EQ_WEAPON_RIMMERACE_LASER"
00:39:25.173 [Ship_Storage_Helper.js]: 3: "EQ_WEAPON_RIMMERACE_LASER"
00:39:25.173 [Ship_Storage_Helper.js]: 4: "EQ_WEAPON_NONE"
00:39:25.173 [Ship_Storage_Helper.js]: 5: "EQ_WEAPON_NONE"
00:39:25.173 [Ship_Storage_Helper.js]: 6: []
00:39:25.173 [Ship_Storage_Helper.js]: 7: [["EQ_XENONHUD_VIEWMODE","EQUIPMENT_OK"],<SNIP>,["EQ_ADVANCED_SYSTEM_DATA_MFD","EQUIPMENT_OK"]]
00:39:25.173 [Ship_Storage_Helper.js]: 8: []
00:39:25.173 [Ship_Storage_Helper.js]: 9: 5.4
00:39:25.173 [Ship_Storage_Helper.js]: 10: []
00:39:25.173 [Ship_Storage_Helper.js]: 11: []
00:39:25.173 [Ship_Storage_Helper.js]: 12: 96
00:39:25.174 [Ship_Storage_Helper.js]: 13: 32229
00:39:25.174 [Ship_Storage_Helper.js]: 14: {"usable":1,"mass":93469.9375,"x":78.72611999511719,"y":22.264280319213867,"z":81.19195556640625}
00:39:25.174 [Ship_Storage_Helper.js]: 15: "2|/////////////"
00:39:25.174 [Ship_Storage_Helper.js]: 16: ["EMPTY",null,null,null,null,null]
00:39:25.174 [Ship_Storage_Helper.js]: 17: null
00:39:25.174 [Ship_Storage_Helper.js]: 18: null
00:39:25.174 [Ship_Storage_Helper.js]: 19: [97.93901920318604,null]
00:39:25.174 [Ship_Storage_Helper.js]: 20: null
00:39:25.174 [Ship_Storage_Helper.js]: 21: null
00:39:25.174 [Ship_Storage_Helper.js]: 22: "TRUE"
00:39:25.174 [Ship_Storage_Helper.js]: 23: null
00:39:25.174 [Ship_Storage_Helper.js]: 24: null
00:39:25.174 [Ship_Storage_Helper.js]: 25: null
00:39:25.174 [Ship_Storage_Helper.js]: 26: "DAMAGED"
00:39:25.174 [Ship_Storage_Helper.js]: 27: null
00:39:25.174 [Ship_Storage_Helper.js]: 28: {"json":"{\"sc\":{\"threshold\":90,\"cycler_mask\":15,\"functional\":100,\"version\":3,\"manual_version\":2,\"current_configuration\":3,\"current_cycle_position\":0,\"start_configuration\":3},\"general\":{\"disabled\":false,\"sc_disabled\":false,\"savegame_version\":0}}","enc":"ec475c16379fb9bc9e3f6535fc9d98a2050c9a4559ec1737364434bcf8abb070e7f882212d08720b34f438345b97d561ab3f1ea3b45eb465f9840489f4434421237a927a8738553a1eccc176479d857eac35c65396f152e71e2bcca967b314a6b02573ffd8210257f2e19cf2ba9b97ff8c4e6a2e058e9ed5fd9e2b1aae743fd450ca811b1ab30f07a41c4be51c67e9b626cbbe95d43500bf21cbc4083107c6a51718228a30ae2b0cd15481fbfefec03e1935f8546a6d74742af241845d96d1da212ae577969c4c70b15aec8e3f94cdb4c09e02c4065ae39a133002cf6ca2aee6baa715b455cfb7fc5a256601d03fd1"}
00:39:25.174 [Ship_Storage_Helper.js]: 29: ""
00:39:25.174 [Ship_Storage_Helper.js]: 30: ""
00:39:25.174 [Ship_Storage_Helper.js]: 31: ""
00:39:25.174 [Ship_Storage_Helper.js]: 32: ""
00:39:25.174 [Ship_Storage_Helper.js]: 33: ""
00:39:25.174 [Ship_Storage_Helper.js]: 34: 9
00:39:25.174 [Ship_Storage_Helper.js]: 35: null
00:39:25.174 [Ship_Storage_Helper.js]: 36: 50
Player's ship Cargo Hold before and after replaceShip:

Code: Select all

00:39:25.236 [Ship_Storage_Helper.js]: Cargo Hold before replaceShip: [{"containers":0,"unit":"kg","displayName":"Gold","quantity":499,"commodity":"gold"},{"containers":0,"unit":"kg","displayName":"Platinum","quantity":499,"commodity":"platinum"},{"containers":0,"unit":"g","displayName":"Gem-Stones","quantity":24,"commodity":"gem_stones"}]
<SNIP>
00:39:25.370 [Ship_Storage_Helper.js]: Cargo Hold after replaceShip: [{"containers":0,"unit":"kg","displayName":"Gold","quantity":499,"commodity":"gold"},{"containers":0,"unit":"kg","displayName":"Platinum","quantity":499,"commodity":"platinum"},{"containers":0,"unit":"g","displayName":"Gem-Stones","quantity":24,"commodity":"gem_stones"}]

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6570
Joined: Wed Feb 28, 2007 7:54 am

Re: player.replaceShip doesn't discard old ship's cargo

Post by another_commander »

Probably OXP related; replaceShip works fine here. Test case: without OXPS, load up the Mk3 with any combination of cargo items and issue in the console: player.replaceShip("boa-player"). Ship is replaced and cargo is gone.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: player.replaceShip doesn't discard old ship's cargo

Post by dybal »

another_commander wrote: Sat Jul 25, 2020 5:21 am
Probably OXP related; replaceShip works fine here. Test case: without OXPS, load up the Mk3 with any combination of cargo items and issue in the console: player.replaceShip("boa-player"). Ship is replaced and cargo is gone.
I did as you suggested and was able to reproduce it... the trick is to have only gold, platinum or gem stones in the hold, the times I had anything else in the hold, with the full OXP list installed, the hold was empty after the replaceShip.

From the Latest.log:

Code: Select all

Opening log for Oolite development version 1.89.0.7259-200727-6109294 (x86-64 test release) under Linux 5.4.0-42-generic at 2020-07-27 09:40:24 -0300.
Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz 8 processors detected.
Build options: OpenAL, new planets, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.
<SNIP>
09:40:26.350 [searchPaths.dumpAll]: Resource paths: 
    ~/GNUstep/Applications/Oolite-trunk/oolite.app/Resources
    ~/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns
    AddOns
    ~/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Norby.LogEvents.oxz
    AddOns/Basic-debug.oxz
09:40:26.516 [shipData.load.begin]: Loading ship data.
09:40:26.691 [script.javascript.init]: JavaScript reset successful.
09:40:26.878 [startup.complete]: ========== Loading complete in 1.49 seconds. ==========
09:40:27.195 [debugTCP.connected]: Connected to debug console "DebugConsole".
09:40:38.821 [shipData.load.begin]: Loading ship data.
09:40:38.989 [script.javascript.init]: JavaScript reset successful.
09:40:39.002 [script.javascript.init]: JavaScript reset successful.
09:40:39.022 [script.load.world.listAll]: Loaded 17 world scripts:
    logevents 1.4
    Oolite Equipment Control 1.89
    Oolite Ship Library 1.89
    oolite-cloaking-device 1.89
    oolite-constrictor-hunt 1.89
    oolite-contracts-cargo 1.89
    oolite-contracts-helpers 1.89
    oolite-contracts-parcels 1.89
    oolite-contracts-passengers 1.89
    oolite-libPriorityAI 1.89
    oolite-nova 1.89
    oolite-populator 1.89
    oolite-primable-equipment-register 1.89
    oolite-registership 1.89
    oolite-thargoid-plans 1.89
    oolite-trumbles 1.89
    oolite-tutorial 1.89
<SNIP>
09:40:58.738 [LogEvents]: gui screen will change from GUI_SCREEN_STATUS to GUI_SCREEN_MANIFEST
09:40:58.741 [LogEvents]: gui screen changed from GUI_SCREEN_STATUS to GUI_SCREEN_MANIFEST
09:41:12.920 [LogEvents]: ship got EQ_CLOAKING_DEVICE
09:41:12.985 [LogEvents]: ship got EQ_ECM
09:41:12.986 [LogEvents]: ship got EQ_ESCAPE_POD
09:41:13.201 [LogEvents]: ship got EQ_CLOAKING_DEVICE
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called oolite-constrictor-hunt, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called Oolite Equipment Control, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called oolite-contracts-passengers, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called oolite-registership, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called oolite-contracts-parcels, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called oolite-tutorial, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called oolite-contracts-cargo, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.203 [dybal.trace]: doWorldScriptEvent: called oolite-nova, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called Oolite Ship Library, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [LogEvents]: bought new ship: Boa null
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called logevents, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called oolite-libPriorityAI, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called oolite-contracts-helpers, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called oolite-populator, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called oolite-trumbles, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called oolite-primable-equipment-register, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called oolite-thargoid-plans, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:13.204 [dybal.trace]: doWorldScriptEvent: called oolite-cloaking-device, playerBoughtNewShip ({commodity = gold; containers = 0; displayName = Gold; quantity = 499; unit = kg; }, {commodity = platinum; containers = 0; displayName = Platinum; quantity = 482; unit = kg; }, {commodity = "gem_stones"; containers = 0; displayName = "Gem-Stones"; quantity = 7; unit = g; })
09:41:20.450 [LogEvents]: gui screen will change from GUI_SCREEN_MANIFEST to GUI_SCREEN_INTERFACES
This is what I altered in the core game:

Code: Select all

diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m
index 4f9343e7..9d2bd0be 100644
--- a/src/Core/Entities/PlayerEntity.m
+++ b/src/Core/Entities/PlayerEntity.m
@@ -12761,6 +12763,8 @@ static NSString *last_outfitting_key=nil;

 - (void) doWorldScriptEvent:(jsid)message inContext:(JSContext *)context withArguments:(jsval *)argv count:(uintN)argc timeLimit:(OOTimeDelta)limit
 {
+       NSString *evento = OOStringFromJSID(message);
+       NSArray *cargo = [self cargoListForScripting];
        NSParameterAssert(context != NULL && JS_IsInRequest(context));
        
        NSEnumerator                   *scriptEnum = nil;
@@ -12770,7 +12774,11 @@ static NSString *last_outfitting_key=nil;
        {
                OOJSStartTimeLimiterWithTimeLimit(limit);
                [theScript callMethod:message inContext:context withArguments:argv count:argc result:NULL];
-               OOJSStopTimeLimiter();
+ //             OOJSStopTimeLimiter();
+               if ([evento isEqualToString:@"playerBoughtNewShip"]) {
+                       cargo = [self cargoListForScripting];
+                       OOLog(@"dybal.trace", @"doWorldScriptEvent: called %@, %@ %@", theScript.name, evento, cargo);
+               }
        }
 }
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6570
Joined: Wed Feb 28, 2007 7:54 am

Re: player.replaceShip doesn't discard old ship's cargo

Post by another_commander »

Confirmed. Fixxoring. Stand by...

Edit: Commit d1ab638.
Post Reply