@@ -796,16 +796,13 @@ function YRV3:FinishSale()
796796
797797 self .m_has_triggered_autosell = true
798798 script .execute_as_script (sn , function ()
799- if not self .m_raw_data .SellScripts [sn ].b then -- gb_*
799+ if ( not self .m_raw_data .SellScripts [sn ].b ) then
800800 for _ , data in pairs (self .m_raw_data .SellScripts [sn ]) do
801801 locals .set_int (sn , data .l + data .o , data .v )
802802 end
803- else -- fm_content_*
804- if (NETWORK .NETWORK_GET_HOST_OF_THIS_SCRIPT () ~= Self :GetPlayerID ()) then
805- Notifier :ShowWarning (
806- " YRV3" ,
807- " Unable to finish sale mission. You are not host of this script."
808- )
803+ else
804+ if (not Self :IsHostOfScript (sn )) then
805+ Notifier :ShowError (" YRV3" , _T (" YRV3_SCRIPT_HOST_ERR" ))
809806 return
810807 end
811808
@@ -821,38 +818,34 @@ function YRV3:FinishSale()
821818end
822819
823820function YRV3 :FinishCEOCargoSourceMission ()
824- if script .is_active (" gb_contraband_buy" ) then
825- script .execute_as_script (" gb_contraband_buy" , function ()
826- if (not NETWORK .NETWORK_IS_HOST_OF_THIS_SCRIPT ()) then
827- Notifier :ShowError (" YRV3" , " You are not host of this script." )
828- return
829- end
821+ if (script .is_active (" gb_contraband_buy" )) then
822+ if (not Self :IsHostOfScript (" gb_contraband_buy" )) then
823+ Notifier :ShowError (" YRV3" , _T (" YRV3_SCRIPT_HOST_ERR" ))
824+ return
825+ end
830826
831- local buyLocal = SGSL :Get (SGSL .data .gb_contraband_buy_local_1 ):AsLocal ()
832- buyLocal :At (5 ):WriteInt (1 ) -- 1.71 b3568.0 -- case -1: return "INVALID - UNSET";
833- buyLocal :At (191 ):WriteInt (6 ) -- 1.71 b3568.0 -- Local_623.f_191 = iParam0;
834- buyLocal :At (192 ):WriteInt (4 ) -- 1.71 b3568.0 -- Local_623.f_192 = iParam0;
835- end )
836- elseif script .is_active (" fm_content_cargo" ) then
837- script .execute_as_script (" fm_content_cargo" , function ()
838- if not NETWORK .NETWORK_IS_HOST_OF_THIS_SCRIPT () then
839- Notifier :ShowError (" YRV3" , " You are not host of this script." )
840- return
841- end
827+ local buyLocal = SGSL :Get (SGSL .data .gb_contraband_buy_local_1 ):AsLocal ()
828+ buyLocal :At (5 ):WriteInt (1 )
829+ buyLocal :At (191 ):WriteInt (6 )
830+ buyLocal :At (192 ):WriteInt (4 )
831+ elseif (script .is_active (" fm_content_cargo" )) then
832+ if (not Self :IsHostOfScript (" fm_content_cargo" )) then
833+ Notifier :ShowError (" YRV3" , _T (" YRV3_SCRIPT_HOST_ERR" ))
834+ return
835+ end
842836
843- local fmccLocal2 = SGSL :Get (SGSL .data .gb_contraband_buy_local_2 ):AsLocal ():At (1 ):At (0 ) -- GENERIC_BITSET_I_WON -- 1.71 b3568.0: var uLocal_5973 = 4;
844- local gbcb_obj = SGSL :Get (SGSL .data .gb_contraband_buy_local_3 )
845- local fmccLocal3 = gbcb_obj :AsLocal ()
846- local fmccLocal3Offset = gbcb_obj :GetOffset (1 )
847- local bs = fmccLocal2 :ReadInt ()
837+ local fmccLocal2 = SGSL :Get (SGSL .data .gb_contraband_buy_local_2 ):AsLocal ():At (1 ):At (0 )
838+ local gbcb_obj = SGSL :Get (SGSL .data .gb_contraband_buy_local_3 )
839+ local fmccLocal3 = gbcb_obj :AsLocal ()
840+ local fmccLocal3Offset = gbcb_obj :GetOffset (1 )
841+ local bs = fmccLocal2 :ReadInt ()
848842
849- if (not Bit .is_set (bs , 11 )) then
850- bs = Bit .set (bs , 11 )
851- fmccLocal2 :WriteInt (bs )
852- end
843+ if (not Bit .is_set (bs , 11 )) then
844+ bs = Bit .set (bs , 11 )
845+ fmccLocal2 :WriteInt (bs )
846+ end
853847
854- fmccLocal3 :At (fmccLocal3Offset ):WriteInt (3 ) -- EndReason
855- end )
848+ fmccLocal3 :At (fmccLocal3Offset ):WriteInt (3 )
856849 end
857850end
858851
0 commit comments