GetMass() ALWAYS Outputting 45678

I’m trying to edit the backpack SEnt ( so it doesn’t allow really big/heavy objects to be added.

For some reason, every prop I try to touch to the backpack is rejected.

Here’s what I have so far:

– other stuff
function ENT:Touch(activator)
if (!self.touched) then
local p = self.Entity:GetNetworkedInt( “number”)
local r = activator:GetClass()
if (activator:IsPlayerHolding( )) and (p < self.max) then
local m = activator:GetModel()
local x = activator.Entity:GetPhysicsObject():GetMass() – always returns as 45678, no matter what prop I touch to it
if (util.IsValidModel(m)) then
if( x >= 30) then – this ALWAYS triggers
PrintMessage(HUD_PRINTTALK, x) return end
local g = {}
g.model = m = activator:GetTable()
g.class = r
table.insert(self.contains, g)
p = p + 1
self.Entity:SetNetworkedInt( “number”, p )
self.touched = true
–stuff below here is irrelevant

I tried looking at WeightStool’s ( code to see how it checks mass, so I could fix my changes accordingly, but it’s just about the same.

Anybody know what’s up, and what I can do to fix it?

Actually, I just saw this. My GetMass is always returning fucking 45678. This is wrong and bad. It’s fucking up all my ideas.

This usually happens when you pickup stuff with the physgun.

What the ASS; you’re right

I just discovered that anytime you pick up a thing with the physgun, its physobj’s mass gets set to 45678, and anytime you pick up a thing with the gravgun, its physobj’s mass gets set to 1

what the HELL

You would not want to know what happens if the mass is otherwise with the physgun, trust me its for your own good

[editline]22nd March 2011[/editline]

blame the source engine

  • snip -