07-06-2016, 08:56 AM
(07-05-2016, 03:38 PM)Grayshift Wrote: I have implemented Erik's suggestions, though I'm unsure as to the reasoning behind them.
I'm sorry for being vague! I'll explain my reasonings behind the suggested changes.
- I would suggest not using the colon operator to seek variables, you could easily replace that with a istype(variable, path) and then typecast.
- the : operator basically overrides type checking, and will compile even if the variable was changed or does not exist.
- The following should be reasonably safe and sound. https://totallynotmy.website/bfd-.txt
- the : operator basically overrides type checking, and will compile even if the variable was changed or does not exist.
- I would suggest changing the if(contrabandLevel) to if(contrabandLevel > 0)
- The former would only trigger if the contraband level would equal one, which would only happen if the user was wearing single contraband item with a low contraband value
- The former would only trigger if the contraband level would equal one, which would only happen if the user was wearing single contraband item with a low contraband value
- You are updating the icon_state for the arrestIcon each Life() tick, I'd suggest checking for changes first, and then updating the icon_state only when there are changes to prevent appearance churn.
- The initial implementation you did would cause each mob to update their security overlay each time Life() was ticked, this would even happen if there where no required updates,
- You can read more about appearance churn here: http://www.byond.com/forum/?post=2081779
- The initial implementation you did would cause each mob to update their security overlay each time Life() was ticked, this would even happen if there where no required updates,