Disclaimer: This isn't necessarily a better way to do things. It's all strictly my own opinion. I just needed a catchy title folks ;p...
Now onto the post!
Alright, I'd say about 75% of everything I've learned programming wise was more or less because of epiphanies. Well, literally just now I had one.
For years I've created a central death control system as followed:
Now, as far as I'm concerned this way is pretty decent and works alright(note that I didn't take into consideration the one killing because I felt it wasn't necessary).
However, I today realized there is a different [arguably better] way...
It plays off the fancy smancy ..() function.
If you are not formilar with the ..() function. More or less what it does is causes the proc/verb to do it's parent function.
Any who... Here is how I now think a Death proc should be made...
world/mob = /mob/Player/ //Set the clients default mob to mob/Player
I don't know. Just to me this little feature seems like it could potential help save a lot of unneeded checking...
It also turns out that it gets a little more indef than just this.
Say for instance your path doesn't contain one item but several. It actually goes down the tree from top to bottom. Here is my script I used to test.
It displays player base then mob base then root base... As state, I just really thought this was neat and practical..
Lastly, an even closer look at how this could all help you... You can also use . to control the ..()'s return value.. Yet another example...
Honestly, I can't really think of anything too too good for this at the moment. However, I am very sure I will take advantage of this system in the future..