Skip to content

Commit

Permalink
Various things
Browse files Browse the repository at this point in the history
  • Loading branch information
marchc1 committed Sep 2, 2024
1 parent b7e772a commit 8dae6a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lua/acf/core/classes/entities/registration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function Entities.AutoRegister(ENT)
ACF.RestoreEntity(self)

hook.Run("ACF_OnEntityUpdate", Class, self, ClientData)

if self.UpdateOverlay then self:UpdateOverlay(true) end
net.Start("ACF_UpdateEntity")
net.WriteEntity(self)
net.Broadcast()
Expand Down Expand Up @@ -214,7 +214,7 @@ function Entities.AutoRegister(ENT)
end

New:ACF_UpdateEntityData(ClientData)

if New.UpdateOverlay then New:UpdateOverlay(true) end
ACF.CheckLegal(New)

return New
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/menu/items_cl/baseplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local gridMaterial = CreateMaterial("acf_bp_vis_spropgrid1", "VertexLitGeneric",
local function CreateMenu(Menu)
ACF.SetToolMode("acf_menu", "Spawner", "Baseplate")
ACF.SetClientData("PrimaryClass", "acf_baseplate")
ACF.SetClientData("SecondaryClass", "acf_baseplate_replace")
ACF.SetClientData("SecondaryClass", "N/A")

Menu:AddTitle("Baseplate Settings")

Expand Down
9 changes: 9 additions & 0 deletions lua/entities/acf_baseplate/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ function ENT:ACF_PostSpawn(_, _, _, ClientData)
local EntMods = ClientData.EntityMods
if EntMods and EntMods.mass then
ACF.Contraption.SetMass(self, self.ACF.Mass or 1)
else
ACF.Contraption.SetMass(self, 1000)
print(self:GetPhysicsObject():GetMass())
end
end

local Text = "Baseplate Size: %dx%dx%d"

function ENT:UpdateOverlayText()
return Text:format(self.Size[1], self.Size[2], self.Size[3])
end

Entities.Register()

0 comments on commit 8dae6a2

Please sign in to comment.