Skip to content

Commit

Permalink
Tweak handling of class models
Browse files Browse the repository at this point in the history
This should be consistent with everything else now, but if this somehow breaks a third-party fuel tank class then it can be changed later
  • Loading branch information
thecraftianman committed Nov 28, 2023
1 parent 9b63447 commit d5b5de8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions lua/acf/core/classes/fuel_tanks/registration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ end
function FuelTanks.RegisterItem(ID, ClassID, Data)
local Class = Classes.AddGroupItem(ID, ClassID, Entries, Data)

if Class.Model == nil then
Class.Model = "models/fueltank/fueltank_4x4x4.mdl"
end

if Class.Name == nil then
Class.Name = "Fuel Box"
end
Expand Down
4 changes: 2 additions & 2 deletions lua/acf/menu/items_cl/engines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ local function CreateMenu(Menu)

ACF.SetClientData("FuelTank", Data.ID)

FuelPreview:UpdateModel(ClassData.Model or Data.Model)
FuelPreview:UpdateSettings(ClassData.Preview or Data.Preview)
FuelPreview:UpdateModel(Data.Model or ClassData.Model)
FuelPreview:UpdateSettings(Data.Preview or ClassData.Preview)

FuelType:UpdateFuelText()
end
Expand Down
2 changes: 1 addition & 1 deletion lua/entities/acf_fueltank/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ do -- Spawn and Update functions
local Percentage = Entity.Capacity and Entity.Fuel / Entity.Capacity or 1

Entity.ACF = Entity.ACF or {}
Entity.ACF.Model = Class.Model or FuelTank and FuelTank.Model -- Must be set before changing model
Entity.ACF.Model = FuelTank and FuelTank.Model or Class.Model -- Must be set before changing model
Entity.ClassData = Class

if Class.IsScalable then
Expand Down

0 comments on commit d5b5de8

Please sign in to comment.