Garry's Mod

Garry's Mod

Gredwitch's Base
LaZycAt 14 Aug, 2021 @ 12:18am
attempt to call field 'IsCar' (a nil value)
when shell/rocket tries to hit an entity, instead of explode it gone crazy any flys around, exception pops out

[Gredwitch's Base] lua/entities/base_rocket/init.lua:600: attempt to call field 'IsCar' (a nil value) 1. AddOnExplode - lua/entities/base_rocket/init.lua:600 2. Explode - lua/entities/base_bomb/init.lua:139 3. unknown - lua/entities/base_rocket/init.lua:408

I think the entity it tried to hit don't have IsCar() function, perhaps add one more check?
if IsValid(tr.Entity) and simfphys and simfphys.IsCar and simfphys.IsCar(tr.Entity) then