From 3087cdffa74976fe0d724de910caf5910d2ea6da Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Fri, 1 Nov 2019 05:32:28 -0600 Subject: [PATCH 1/3] Initial migration to NW2 from DTVars Replaced all DataTable networking with NW2 to mitigate issues with 2019-11 Garry's Mod update --- lua/autorun/photon/cl_emv_meta.lua | 26 ++++----- lua/autorun/photon/cl_photon_hud.lua | 22 +++++++- lua/autorun/photon/cl_photon_meta.lua | 12 ++--- lua/autorun/photon/sh_emv_config.lua | 2 +- lua/autorun/photon/sh_emv_meta.lua | 20 +++---- lua/autorun/photon/sv_emv_meta.lua | 73 +++++++++++++------------- lua/autorun/photon/sv_emv_net.lua | 2 +- lua/autorun/photon/sv_photon_hooks.lua | 2 +- lua/autorun/photon/sv_photon_meta.lua | 34 ++++++------ 9 files changed, 108 insertions(+), 85 deletions(-) diff --git a/lua/autorun/photon/cl_emv_meta.lua b/lua/autorun/photon/cl_emv_meta.lua index 7f0f8d91..d5e69447 100644 --- a/lua/autorun/photon/cl_emv_meta.lua +++ b/lua/autorun/photon/cl_emv_meta.lua @@ -41,12 +41,12 @@ function EMVU:MakeEMV( emv, name ) function emv:Photon_Lights() if not IsValid( self ) then return false end - return self:GetDTBool( EMV_LIGHTS_ON ) + return self:GetNW2Bool("PhotonLE.EMV_LIGHTS_ON", false) end function emv:Photon_LightOption() if not IsValid( self ) then return 1 end - return self:GetDTInt( EMV_LIGHT_OPTION ) + return self:GetNW2Int( "PhotonLE.EMV_LIGHT_OPTION", 1 ) end function emv:Photon_LightOptionID() @@ -67,27 +67,27 @@ function EMVU:MakeEMV( emv, name ) function emv:Photon_Siren() if not IsValid( self ) then return false end - return self:GetDTBool( EMV_SIREN_ON ) + return self:GetNW2Bool( "PhotonLE.EMV_SIREN_ON" ) end function emv:Photon_SirenOption() if not IsValid( self ) then return 1 end - return self:GetDTInt( EMV_SIREN_OPTION ) + return self:GetNW2Int( "PhotonLE.EMV_SIREN_OPTION" ) end function emv:Photon_AuxSirenSet() if not IsValid( self ) then return end - return self:GetDTInt(EMV_SIREN_SECONDARY) + return self:GetNW2Int("PhotonLE.EMV_SIREN_SECONDARY") end function emv:Photon_SirenSet() if not IsValid( self ) then return 1 end - return self:GetDTInt( EMV_SIREN_SET ) + return self:GetNW2Int("PhotonLE.EMV_SIREN_SET") end function emv:Photon_ManualSiren() if not IsValid( self ) then return false end - return self:GetDTBool( CAR_MANUAL ) + return self:GetNW2Bool( "PhotonLE.CAR_MANUAL" ) end function emv:Photon_AlertMode() @@ -96,7 +96,7 @@ function EMVU:MakeEMV( emv, name ) function emv:Photon_ManualHorn() if not IsValid( self ) then return false end - return self:GetDTBool( EMV_HORN ) + return self:GetNW2Bool( "PhotonLE.EMV_HORN" ) end function emv:Photon_NoSiren() @@ -106,12 +106,12 @@ function EMVU:MakeEMV( emv, name ) function emv:Photon_Illumination() if not IsValid( self ) then return false end - return self:GetDTBool( EMV_ILLUM_ON ) + return self:GetNW2Bool( "PhotonLE.EMV_ILLUM_ON" ) end function emv:Photon_IllumOption() if not IsValid( self ) then return 1 end - return self:GetDTInt( EMV_ILLUM_OPTION ) + return self:GetNW2Int( "PhotonLE.EMV_ILLUM_OPTION" ) end function emv:Photon_IllumLights() @@ -135,7 +135,7 @@ function EMVU:MakeEMV( emv, name ) function emv:Photon_TrafficAdvisor() if not IsValid( self ) then return false end - return self:GetDTBool( EMV_TRF_ON ) + return self:GetNW2Bool( "PhotonLE.EMV_TRF_ON" ) end function emv:Photon_AuxLights() @@ -144,7 +144,7 @@ function EMVU:MakeEMV( emv, name ) function emv:Photon_TrafficAdvisorOption() if not IsValid( self ) then return 1 end - return self:GetDTInt( EMV_TRF_OPTION ) + return self:GetNW2Int( "PhotonLE.EMV_TRF_OPTION" ) end function emv:Photon_HasTrafficAdvisor() @@ -154,7 +154,7 @@ function EMVU:MakeEMV( emv, name ) function emv:Photon_ELPresetOption() if not IsValid( self ) then return 0 end - return self:GetDTInt( EMV_PRE_OPTION ) + return self:GetNW2Int( "PhotonLE.EMV_PRE_OPTION" ) end function emv:Photon_PresetEnabled() diff --git a/lua/autorun/photon/cl_photon_hud.lua b/lua/autorun/photon/cl_photon_hud.lua index b5fc1c40..36f66334 100644 --- a/lua/autorun/photon/cl_photon_hud.lua +++ b/lua/autorun/photon/cl_photon_hud.lua @@ -712,5 +712,25 @@ Photon.AddCustomHUDIcon("volume-mute", "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABz -- end -- hook.Add( "PostDrawTranslucentRenderables", "photoasndflaskdf", function() - //PhotonTestDraw() + --PhotonTestDraw() +-- end) + +--- TODO: REMOVE (DEV FUNCTION ONLY) FOR GRAND LAKE TESTING +-- print("PHOTON UPDATED") +function photonDebugInfo() + print("PHOTON DEBUG INFO FUNCTION ==============") + local veh = LocalPlayer():GetVehicle() + if not IsValid(veh) then + print("> Invalid Vehicle") + return + end + print("> Name: " .. tostring(veh.VehicleName)) + if not veh:Photon() then print("> Photon(): false") end + if not veh:IsEMV() then print("> IsEMV(): false") end + timer.Simple(0.5, function() + photonDebugInfo() + end) +end +-- timer.Create("PhotonDebugUpdate", 0.5, 0, function() +-- photonDebugInfo() -- end) \ No newline at end of file diff --git a/lua/autorun/photon/cl_photon_meta.lua b/lua/autorun/photon/cl_photon_meta.lua index c7dfc4ac..68571821 100644 --- a/lua/autorun/photon/cl_photon_meta.lua +++ b/lua/autorun/photon/cl_photon_meta.lua @@ -10,27 +10,27 @@ function Photon:SetupCar( ent, index ) function ent:Photon_HeadlightsOn() if not IsValid( self ) then return false end - return self:GetDTBool( CAR_HEADLIGHTS ) + return self:GetNW2Bool( "PhotonLE.CAR_HEADLIGHTS" ) end function ent:Photon_IsBraking() if not IsValid( self ) then return false end - return self:GetDTBool( CAR_BRAKING ) + return self:GetNW2Bool( "PhotonLE.CAR_BRAKING" ) end function ent:Photon_IsReversing() if not IsValid( self ) then return false end - return self:GetDTBool( CAR_REVERSING ) + return self:GetNW2Bool( "PhotonLE.CAR_REVERSING" ) end function ent:Photon_IsRunning() if not IsValid( self ) then return false end - return self:GetDTBool( CAR_RUNNING ) + return self:GetNW2Bool( "PhotonLE.CAR_RUNNING" ) end function ent:Photon_BlinkState() if not IsValid( self ) then return 0 end - return self:GetDTInt( CAR_BLINKER ) + return self:GetNW2Int( "PhotonLE.CAR_BLINKER" ) end function ent:Photon_TurningLeft() @@ -50,7 +50,7 @@ function Photon:SetupCar( ent, index ) function ent:Photon_WheelOption() if not IsValid( self ) then return 1 end - return self:GetDTInt( CAR_WHEEL_OPTION ) + return self:GetNW2Int( "PhotonLE.CAR_WHEEL_OPTION" ) end function ent:Photon_WheelEnabled() diff --git a/lua/autorun/photon/sh_emv_config.lua b/lua/autorun/photon/sh_emv_config.lua index d1e6bdde..1af77564 100644 --- a/lua/autorun/photon/sh_emv_config.lua +++ b/lua/autorun/photon/sh_emv_config.lua @@ -17,7 +17,7 @@ PHOTON_SERIES = "Fair Oaks | Siren Hotfix" ]]-- -- Booleans -local BOOL_CONST_OFFSET = 19 +local BOOL_CONST_OFFSET = 10 EMV_LIGHTS_ON = BOOL_CONST_OFFSET + 0 EMV_SIREN_ON = BOOL_CONST_OFFSET + 1 diff --git a/lua/autorun/photon/sh_emv_meta.lua b/lua/autorun/photon/sh_emv_meta.lua index 82b4049c..46aacd02 100644 --- a/lua/autorun/photon/sh_emv_meta.lua +++ b/lua/autorun/photon/sh_emv_meta.lua @@ -9,21 +9,21 @@ local istable = istable function ent:IsEMV() if not IsValid( self ) then return false end if not EMV_INDEX then return false end - local str = self:GetDTString( EMV_INDEX ) + local str = self:GetNW2String( "PhotonLE.EMV_INDEX" ) if string.StartWith( tostring(str), "ö" ) then return true end return false end function ent:Photon() -- return self:GetNWString( "PhotonVehicle", false ) - return ( IsValid( self ) and self:IsVehicle() and self:GetDTBool( CAR_HAS_PHOTON ) ) or false + return ( IsValid( self ) and self:IsVehicle() and self:GetNW2Bool( "PhotonLE.CAR_HAS_PHOTON" ) ) or false end function ent:HasPhotonELS() if not IsValid( self ) then return false end if not EMV_INDEX then return false end if not self:IsEMV() then return false end - if not self:GetDTBool( CAR_USE_EL ) then return false end + if not self:GetNW2Bool( "PhotonLE.CAR_USE_EL" ) then return false end return true end @@ -31,7 +31,7 @@ function ent:EMVName() if not IsValid( self ) then return "" end if not EMV_INDEX then return "" end if self:IsEMV() then - return string.Explode( "ö", self:GetDTString( EMV_INDEX ), false )[2] + return string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false )[2] end return "" end @@ -47,11 +47,11 @@ function ent:Photon_AdjustedSpeed() end function ent:Photon_GetUnitNumber() - return string.Explode( "ö", self:GetDTString( EMV_INDEX ), false )[3] or "" + return string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false )[3] or "" end function ent:Photon_GetLiveryID() - return string.Explode( "ö", self:GetDTString( EMV_INDEX ), false )[4] or "" + return string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false )[4] or "" end function ent:Photon_GetAutoSkinIndex() @@ -77,12 +77,12 @@ function ent:SetSkin( index ) end function ent:Photon_SelectionString() - return string.Explode( "ö", self:GetDTString( EMV_INDEX ), false )[5] + return string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false )[5] end function ent:Photon_SelectionTable() - -- print(tostring(self:GetDTString( EMV_INDEX ))) - local selectionString = string.Explode( "ö", self:GetDTString( EMV_INDEX ), false )[5] + -- print(tostring(self:GetNW2String( EMV_INDEX ))) + local selectionString = string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false )[5] -- print(tostring(selectionString)) return string.Explode( ".", selectionString, false ) end @@ -189,7 +189,7 @@ function ent:Photon_ImportSelectionData( inputData ) end function ent:Photon_GetUtilStringTable() - return string.Explode( "ö", self:GetDTString( EMV_INDEX ), false ) + return string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false ) end function ent:Photon_SelectionEnabled() diff --git a/lua/autorun/photon/sv_emv_meta.lua b/lua/autorun/photon/sv_emv_meta.lua index 2b4463e5..fedb0d4e 100644 --- a/lua/autorun/photon/sv_emv_meta.lua +++ b/lua/autorun/photon/sv_emv_meta.lua @@ -18,39 +18,39 @@ function EMVU:MakeEMV( ent, emv ) -- whether or not the car truly uses emergency lights function ent:ELS_Enabled( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTBool(CAR_USE_EL, val) end - return self:GetDTBool(CAR_USE_EL) + if (val~=nil) then self:SetNW2Bool("PhotonLE.CAR_USE_EL", val) end + return self:GetNW2Bool("PhotonLE.CAR_USE_EL") end -- Lights on/off function ent:ELS_Lights( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTBool(EMV_LIGHTS_ON, val) end - return self:GetDTBool(EMV_LIGHTS_ON) + if (val~=nil) then self:SetNW2Bool("PhotonLE.EMV_LIGHTS_ON", val) end + return self:GetNW2Bool("PhotonLE.EMV_LIGHTS_ON") end -- Light pattern/option function ent:ELS_LightOption( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTInt(EMV_LIGHT_OPTION, val) end - return self:GetDTInt(EMV_LIGHT_OPTION) + if (val~=nil) then self:SetNW2Int("PhotonLE.EMV_LIGHT_OPTION", val) end + return self:GetNW2Int("PhotonLE.EMV_LIGHT_OPTION") end -- Siren on/off function ent:ELS_Siren( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTBool(EMV_SIREN_ON, val) end - return self:GetDTBool(EMV_SIREN_ON) + if (val~=nil) then self:SetNW2Bool("PhotonLE.EMV_SIREN_ON", val) end + return self:GetNW2Bool("PhotonLE.EMV_SIREN_ON") end -- Siren tone function ent:ELS_SirenOption( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTInt(EMV_SIREN_OPTION, val) end - return self:GetDTInt(EMV_SIREN_OPTION) + if (val~=nil) then self:SetNW2Int("PhotonLE.EMV_SIREN_OPTION", val) end + return self:GetNW2Int("PhotonLE.EMV_SIREN_OPTION") end -- Siren set @@ -58,17 +58,17 @@ function EMVU:MakeEMV( ent, emv ) if not IsValid( self ) then return end if (val~=nil) then self:ELS_SirenOption( 1 ) - self:SetDTInt(EMV_SIREN_SET, val) + self:SetNW2Int("PhotonLE.EMV_SIREN_SET", val) end - return self:GetDTInt(EMV_SIREN_SET) + return self:GetNW2Int("PhotonLE.EMV_SIREN_SET") end function ent:ELS_AuxSirenSet( val ) if not IsValid( self ) then return end if (val~=nil) then - self:SetDTInt(EMV_SIREN_SECONDARY, val) + self:SetNW2Int("PhotonLE.EMV_SIREN_SECONDARY", val) end - return self:GetDTInt(EMV_SIREN_SECONDARY) + return self:GetNW2Int("PhotonLE.EMV_SIREN_SECONDARY") end function ent:ELS_HasAuxSiren() @@ -78,29 +78,29 @@ function EMVU:MakeEMV( ent, emv ) -- Traffic on/off function ent:ELS_Traffic( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTBool( EMV_TRF_ON, val ) end - return self:GetDTBool( EMV_TRF_ON ) + if (val~=nil) then self:SetNW2Bool( "PhotonLE.EMV_TRF_ON", val ) end + return self:GetNW2Bool( "PhotonLE.EMV_TRF_ON" ) end -- Traffic direction function ent:ELS_TrafficOption( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTInt (EMV_TRF_OPTION, val ) end - return self:GetDTInt( EMV_TRF_OPTION ) + if (val~=nil) then self:SetNW2Int ("PhotonLE.EMV_TRF_OPTION", val ) end + return self:GetNW2Int( "PhotonLE.EMV_TRF_OPTION" ) end -- Takedowns/alley lights on/off function ent:ELS_Illuminate( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTBool( EMV_ILLUM_ON, val ) end - return self:GetDTBool( EMV_ILLUM_ON ) + if (val~=nil) then self:SetNW2Bool( "PhotonLE.EMV_ILLUM_ON", val ) end + return self:GetNW2Bool( "PhotonLE.EMV_ILLUM_ON" ) end -- Takedowns/alley lights option function ent:ELS_IlluminateOption( val ) if not IsValid( self ) then return end - if (val~=nil) then self:SetDTInt( EMV_ILLUM_OPTION, val ) end - return self:GetDTInt( EMV_ILLUM_OPTION ) + if (val~=nil) then self:SetNW2Int( "PhotonLE.EMV_ILLUM_OPTION", val ) end + return self:GetNW2Int( "PhotonLE.EMV_ILLUM_OPTION" ) end function ent:ELS_PresetOption( val ) @@ -108,13 +108,13 @@ function EMVU:MakeEMV( ent, emv ) if not EMVU.PresetIndex[ self.Name ] then print( "[Photon] No presets found for " .. tostring( self.Name ) .. ". Please check for errors above." ) return end if (val~=nil) then val = math.Clamp( val, 0, #EMVU.PresetIndex[ self.Name ] ) - self:SetDTInt( EMV_PRE_OPTION, val ) + self:SetNW2Int( "PhotonLE.EMV_PRE_OPTION", val ) local bgData = EMVU.Helper:BodygroupPreset( self, val ) for _,bg in pairs( bgData ) do self:SetBodygroup( bg[1], bg[2] ) end end - return self:GetDTInt( EMV_PRE_OPTION ) + return self:GetNW2Int( "PhotonLE.EMV_PRE_OPTION" ) end function ent:ELS_IllumOn() @@ -377,10 +377,10 @@ function EMVU:MakeEMV( ent, emv ) function ent:ELS_ManualSiren( state ) if not IsValid( self ) then return end if self:ELS_NoSiren() then return end - + print("SETTING MANUAL SIREN STATE") if state then --if self:ELS_SirenOption() == 1 and self:ELS_Siren() then return end - self:SetDTBool( CAR_MANUAL, true ) + self:SetNW2Bool( "PhotonLE.CAR_MANUAL", true ) if ( not self:Photon_HasManualWind() ) or self:ELS_Siren() then local manSiren = EMVU.GetSirenTable()[self:ELS_SirenSet()].Set[1].Sound if EMVU.GetSirenTable()[self:ELS_SirenSet()].Manual then manSiren = EMVU.GetSirenTable()[self:ELS_SirenSet()].Manual end @@ -420,7 +420,7 @@ function EMVU:MakeEMV( ent, emv ) end end end - self:SetDTBool( CAR_MANUAL, false ) + self:SetNW2Bool( "PhotonLE.CAR_MANUAL", false ) end end @@ -428,7 +428,7 @@ function EMVU:MakeEMV( ent, emv ) if not IsValid( self ) then return end if self:ELS_NoSiren() then return end if state then - self:SetDTBool( EMV_HORN, true ) + self:SetNW2Bool( "PhotonLE.EMV_HORN", true ) local horn = EMVU.Horns[1] if EMVU.GetSirenTable()[self:ELS_SirenSet()].Horn then horn = EMVU.GetSirenTable()[self:ELS_SirenSet()].Horn end self.ELS.Horn = CreateSound( self, horn ) @@ -442,7 +442,7 @@ function EMVU:MakeEMV( ent, emv ) self.ELS.Horn:PlayEx( 0, 100 ) self.ELS.Horn:ChangeVolume( 1, 0 ) else - self:SetDTBool( EMV_HORN, false ) + self:SetNW2Bool( "PhotonLE.EMV_HORN", false ) if self.ELS.Horn then self.ELS.Horn:Stop() end end end @@ -521,9 +521,9 @@ function EMVU:MakeEMV( ent, emv ) end function ent:Photon_SetLiveryId( val ) - local curdata = string.Explode( "ö", self:GetDTString( EMV_INDEX ), false ) + local curdata = string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false ) curdata[4] = val - self:SetDTString( EMV_INDEX, table.concat( curdata, "ö" )) + self:SetNW2String( "PhotonLE.EMV_INDEX", table.concat( curdata, "ö" )) end function ent:Photon_SetUnitNumber( val ) @@ -531,9 +531,9 @@ function EMVU:MakeEMV( ent, emv ) if string.len( val ) > 3 then val = string.sub( val, 1, 3 ) end if not string.match( val, "%w" ) then val = "" end if PHOTON_BANNED_UNIT_IDS[ string.lower( val ) ] then val = "" end - local curdata = string.Explode( "ö", self:GetDTString( EMV_INDEX ), false ) + local curdata = string.Explode( "ö", self:GetNW2String( "PhotonLE.EMV_INDEX" ), false ) curdata[3] = val - self:SetDTString( EMV_INDEX, table.concat( curdata, "ö" ) ) + self:SetNW2String( "PhotonLE.EMV_INDEX", table.concat( curdata, "ö" ) ) return val end @@ -576,7 +576,7 @@ function EMVU:MakeEMV( ent, emv ) end function ent:Photon_SetUtilString( str ) - self:SetDTString( EMV_INDEX, str ) + self:SetNW2String( "PhotonLE.EMV_INDEX", str ) end function ent:Photon_HasManualWind() @@ -603,7 +603,7 @@ function EMVU:MakeEMV( ent, emv ) end ent.IsEMV = true - ent:SetDTString( EMV_INDEX, "ö" .. tostring( ent.Name ) .. "ööö." ) -- Al + ent:SetNW2String( "PhotonLE.EMV_INDEX", "ö" .. tostring( ent.Name ) .. "ööö." ) -- Al ------ APPLY EMV PARAMETERS ------ @@ -646,7 +646,7 @@ function EMVU:MakeEMV( ent, emv ) if istable( emv.Auto ) and emv.Auto[1] and istable( emv.Presets ) then ent:ELS_PresetOption( 1 ) end - + ent:ELS_SirenOption( 1 ) ent:ELS_LightOption( 1 ) ent:ELS_IlluminateOption ( 1 ) @@ -654,6 +654,7 @@ function EMVU:MakeEMV( ent, emv ) ent:ELS_SirenOff() ent:ELS_LightsOff() ent:ELS_Enabled( true ) + ent:ELS_ManualSiren( false ) ent:Photon_ApplySubMaterials() ent:Photon_ResetSelections() end diff --git a/lua/autorun/photon/sv_emv_net.lua b/lua/autorun/photon/sv_emv_net.lua index 34bcb956..45ddf967 100644 --- a/lua/autorun/photon/sv_emv_net.lua +++ b/lua/autorun/photon/sv_emv_net.lua @@ -224,7 +224,7 @@ concommand.Add( "photon_stick", function( ply, cmd, args ) if not IsValid( ply ) or not ply:IsAdmin() then return end local car = ply:GetVehicle() if not IsValid( car ) or not car:Photon() then return end - car:StayOn( !car:StayOn() ) + car:SetPhotonLEStayOn(!car:GetPhotonLEStayOn()) end ) function Photon.Net:NotifyLiveryUpdate( id, unit, ent ) diff --git a/lua/autorun/photon/sv_photon_hooks.lua b/lua/autorun/photon/sv_photon_hooks.lua index ab214856..84477acc 100644 --- a/lua/autorun/photon/sv_photon_hooks.lua +++ b/lua/autorun/photon/sv_photon_hooks.lua @@ -14,7 +14,7 @@ function Photon:RunningScan() v.LastSpeed = v:Photon_GetSpeed() - elseif IsValid( v) and not v:GetDriver():IsValid() and not v:GetDriver():IsPlayer() and not v:StayOn() then + elseif IsValid( v) and not v:GetDriver():IsValid() and not v:GetDriver():IsPlayer() and not v:GetPhotonLEStayOn() then v:CAR_Running( false ) v:CAR_Braking( false ) v:CAR_Reversing( false ) diff --git a/lua/autorun/photon/sv_photon_meta.lua b/lua/autorun/photon/sv_photon_meta.lua index 28c87c54..92fcae94 100644 --- a/lua/autorun/photon/sv_photon_meta.lua +++ b/lua/autorun/photon/sv_photon_meta.lua @@ -3,38 +3,38 @@ function Photon:SetupCar( ent, index ) // whether car headlights are on or off function ent:CAR_Headlights( val ) if not IsValid( self ) then return false end - if (val!=nil) then self:SetDTBool( CAR_HEADLIGHTS, val ) end - return self:GetDTBool(CAR_HEADLIGHTS) + if (val!=nil) then self:SetNW2Bool( "PhotonLE.CAR_HEADLIGHTS", val ) end + return self:GetNW2Bool("PhotonLE.CAR_HEADLIGHTS") end // if car is braking function ent:CAR_Braking( val ) if not IsValid( self ) then return false end - if (val!=nil) then self:SetDTBool( CAR_BRAKING, val ) end - return self:GetDTBool( CAR_BRAKING ) + if (val!=nil) then self:SetNW2Bool( "PhotonLE.CAR_BRAKING", val ) end + return self:GetNW2Bool( "PhotonLE.CAR_BRAKING" ) end // car reversing function ent:CAR_Reversing( val ) if not IsValid( self ) then return false end - if (val!=nil) then self:SetDTBool( CAR_REVERSING, val ) end - return self:GetDTBool( CAR_REVERSING ) + if (val!=nil) then self:SetNW2Bool( "PhotonLE.CAR_REVERSING", val ) end + return self:GetNW2Bool( "PhotonLE.CAR_REVERSING" ) end function ent:CAR_Running( val ) if not IsValid( self ) then return false end - if (val!=nil) then self:SetDTBool( CAR_RUNNING, val ) end - return self:GetDTBool( CAR_RUNNING ) + if (val!=nil) then self:SetNW2Bool( "PhotonLE.CAR_RUNNING", val ) end + return self:GetNW2Bool( "PhotonLE.CAR_RUNNING" ) end function ent:CAR_Signal( val ) if not IsValid( self ) then return 0 end - if (val!=nil) then self:SetDTInt( CAR_BLINKER, val ) end - return self:GetDTInt( CAR_BLINKER ) + if (val!=nil) then self:SetNW2Int( "PhotonLE.CAR_BLINKER", val ) end + return self:GetNW2Int( "PhotonLE.CAR_BLINKER" ) end @@ -92,9 +92,11 @@ function Photon:SetupCar( ent, index ) return false end - function ent:StayOn( val ) - if val != nil then self:SetNWBool( "PhotonStayOn", val ) end - return self:GetNWBool( "PhotonStayOn", false ) + function ent:GetPhotonLEStayOn() + return self:GetNW2Bool("PhotonLEStayOn", false) + end + function ent:SetPhotonLEStayOn(val) + return self:SetNW2Bool("PhotonLEStayOn", val) end function ent:Photon_WheelEnabled() @@ -110,8 +112,8 @@ function Photon:SetupCar( ent, index ) function ent:Photon_SetWheelIndex( val ) if not IsValid( self ) then return 0 end - if (val!=nil) then self:SetDTInt( CAR_WHEEL_OPTION, val ) end - return self:GetDTInt( CAR_WHEEL_OPTION ) + if (val!=nil) then self:SetNW2Int( "PhotonLE.CAR_WHEEL_OPTION", val ) end + return self:GetNW2Int( "PhotonLE.CAR_WHEEL_OPTION" ) end ent:CAR_Headlights( false ) @@ -122,6 +124,6 @@ function Photon:SetupCar( ent, index ) if ent:Photon_WheelEnabled() then ent:Photon_SetWheelIndex( 1 ) end -- ent:SetNWString( "PhotonVehicle", index ) - ent:SetDTBool( CAR_HAS_PHOTON, true ) + ent:SetNW2Bool( "PhotonLE.CAR_HAS_PHOTON", true ) end \ No newline at end of file From 1aae62ca6beef9552a0e252e8cede5e668a73c7d Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Fri, 1 Nov 2019 05:45:39 -0600 Subject: [PATCH 2/3] You leave the print("SETTING MANUAL SIREN STATE") in? --- lua/autorun/photon/sv_emv_meta.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/autorun/photon/sv_emv_meta.lua b/lua/autorun/photon/sv_emv_meta.lua index fedb0d4e..c8fa08b9 100644 --- a/lua/autorun/photon/sv_emv_meta.lua +++ b/lua/autorun/photon/sv_emv_meta.lua @@ -377,7 +377,6 @@ function EMVU:MakeEMV( ent, emv ) function ent:ELS_ManualSiren( state ) if not IsValid( self ) then return end if self:ELS_NoSiren() then return end - print("SETTING MANUAL SIREN STATE") if state then --if self:ELS_SirenOption() == 1 and self:ELS_Siren() then return end self:SetNW2Bool( "PhotonLE.CAR_MANUAL", true ) From 9c473e55ff47f2381c58e8f9d71b1f311d59a74d Mon Sep 17 00:00:00 2001 From: John Internet Date: Fri, 1 Nov 2019 22:20:15 +0000 Subject: [PATCH 3/3] ID & Name. --- lua/autorun/photon/sh_emv_config.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/autorun/photon/sh_emv_config.lua b/lua/autorun/photon/sh_emv_config.lua index 1af77564..2806c021 100644 --- a/lua/autorun/photon/sh_emv_config.lua +++ b/lua/autorun/photon/sh_emv_config.lua @@ -8,8 +8,8 @@ PHOTON_BANNED_UNIT_IDS = { ["n1g"] = true } -PHOTON_UPDATE = 72.2 -PHOTON_SERIES = "Fair Oaks | Siren Hotfix" +PHOTON_UPDATE = 72.3 +PHOTON_SERIES = "Fair Oaks | November Garry's Mod Update Hotfix" --[[ DATATABLE CONFIGURATIONS