Wire: Wire is not restricting usage of entity models

Created on 7 May 2019  路  3Comments  路  Source: wiremod/wire

Running on the latest git commit/version of Wire (8ae53270ee708b6b9f504c19936dfd91a06943e0).

Demo (~60MB):
https://streamable.com/s97pu

There are a lot of such effects found in HL2 EP1 and EP2, pretty neat.. But, when forced to be used as an model (because they have actual prop model), strange things start to happen.
In the demo I have shown, what happens when you force the lighting effect as an EGP screen:
wire_egp_model "models/props_combine/combine_citadelcloudlight001a.mdl"

When spawned, a script error is triggered as well:

[ERROR] addons/wire/lua/wire/stools/egp.lua:128: Tried to use a NULL physics object!
  1. EnableMotion - [C]:-1
   2. LeftClick - addons/wire/lua/wire/stools/egp.lua:128
    3. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:240

Yet another day, yet another wire issue...

Bug

Most helpful comment

Cut the snide attitude. You can report problems without it.

All 3 comments

Oh, yeah, I should also mention, that because of the script error is produced, it is impossible to undo the EGP screen, an admin must perform a full map cleanup in order to remove such EGP screen...
Fun...
Oh, yeah, you guessed it, it works for other Wire entities as well!

Cut the snide attitude. You can report problems without it.

We have WireLib.CanModel to check whether a player's allowed to spawn something with the given model and skin. If it's not being called for these tools, that's a bug, but it looks like it is getting called by the EGP tool at least. We should potentially check util.IsValidProp instead of util.IsValidModel inside WireLib.CanModel, but this might be too restrictive. (For example, E2 holograms with custom models should be allowed to be ragdolls and effects, not just props.) Maybe tools should explicitly check util.IsValidProp as well as WireLib.CanModel?

We don't want to explicitly allow only the models that are shown in the UI (as there are uses for custom models), and we don't want to explicitly ban certain models (as the list would never be exhaustive). If you want to ban certain models, override the "PlayerSpawnObject" hook on your server.

The script error you show is a separate bug in the EGP tool - this line should read if IsValid(phys) then instead of if (phys) then.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nokoto6 picture nokoto6  路  4Comments

CaptainPRICE picture CaptainPRICE  路  3Comments

CaptainPRICE picture CaptainPRICE  路  9Comments

TAbdiukov picture TAbdiukov  路  5Comments

CSGKCJDBCPQ2K8 picture CSGKCJDBCPQ2K8  路  7Comments