ATTN servers with custom content using onMobDeath

Post Reply
User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

ATTN servers with custom content using onMobDeath

Post by TeoTwawki » Sun May 15, 2016 5:15 pm

How to fix your stuff
As of revision 22ea0bb the function arguments have changed (sorry). If you don't have any custom code using onMobDeath or onMobDeathEx, you can ignore this post.
_________________________

If you are good with regex you can do this all in a single find+replace..If anyone would like to contribute that to the thread, knock yourself out. why didn't I save the regex I used, sigh. Include the spaces when performing these instructions!

Find this string:

Code: Select all

 ally:
Replace with:

Code: Select all

 player:
Find this string:

Code: Select all

(ally
Replace with:

Code: Select all

(player
Find this string:

Code: Select all

onMobDeath(mob,killer,ally)
Replace with:

Code: Select all

onMobDeath(mob, player, isKiller)
Find this string:

Code: Select all

onMobDeath(mob, killer, ally)
Replace with:

Code: Select all

onMobDeath(mob, player, isKiller)
Find this string:

Code: Select all

, ally
Replace with:

Code: Select all

, player
Find this string:

Code: Select all

,ally
Replace with:

Code: Select all

,player
Notice all above I only gave you examples to fix ally and not killer? Killer is gone. If you used it you had broken code this whole time. To act only on the person who landed the killing blow, wrap your code with:

Code: Select all

if (isKiller == true) then
    your Code here
end
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Post Reply