![]() |
|
Proposed change to entities - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: Proposed change to entities (/thread-777.html) |
Proposed change to entities - Person8880 - 06-03-2015 I'm adding bindings to physics objects to Starfall, and I've made it so that if you try to do anything with an invalid physics object, it throws an error instead of returning nil or doing nothing. This makes it much easier for me to bind stuff and handle the behaviour. I want to make the same change to entities, but I'm aware this may break people's stuff. I wanted to ask what people who use Starfall regularly think of the idea, rather than go ahead and change it without warning. Pros:
Also, to help with this, I'm going to make IsValid a standard function in the global table, which will check for both nil values and valid entity/panel/physics object values. Note that for now only the new Physics Object type has this behaviour. RE: Proposed change to entities - Person8880 - 07-03-2015 Just to clarify what this means as the first post was probably not explicit enough: Current system
Proposed system
RE: Proposed change to entities - TheOneAndOnlyTee - 07-03-2015 cool this'll make it easier to identify code that I've messed up lol RE: Proposed change to entities - Person8880 - 07-03-2015 This change has gone in and will be present from the next server restart(s). If you do proper validity checks, you have nothing to worry about! RE: Proposed change to entities - LocInt - 07-03-2015 Well I don't see any wrong in this. |