Author Topic: Suggested check for War3_DealDamageDelayed  (Read 430 times)

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Suggested check for War3_DealDamageDelayed
« on: April 13, 2016, 03:25:27 AM »
Hi guys,

Just wanted to suggest an update for War3_DealDamageDelayed, to add a check that will kill any timer's on round_start.

This is because currently, there's no checks - so if you do a 10 second delayed damage, that damage can actually carry over and apply the next round if the round ends before that.

I know we can obviously do it manually, but just thought a killtimer approach would be a good addition :)

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: Suggested check for War3_DealDamageDelayed
« Reply #1 on: April 13, 2016, 06:23:26 PM »
Unfortunately this is actually a stock not a native so adding the check you mentioned would not be as easy as adding an if statement or something similar (I would have to change it into a native and deal with everything that comes with that).

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Suggested check for War3_DealDamageDelayed
« Reply #2 on: April 15, 2016, 10:19:53 AM »
We can change the stock and add a new parameter that has a default value. Something like:
Code: [Select]
stock War3_DealDamageDelayed(victim,attacker,damage,const String:classname[32],Float:delay=0.0,bool:showDamage=false,showDamage_skill=0,bool:sameRoundCheck=false) {
    new Handle:pack;
    CreateDataTimer(delay, _war3source_Timer_DealDamage, pack);
    WritePackCell(pack, victim);
    WritePackCell(pack, attacker);
    WritePackCell(pack, damage);
    WritePackCell(pack, showDamage);
    WritePackCell(pack, showDamage_skill);
    WritePackString(pack, classname);
    WritePackCell(pack, sameRoundCheck ? War3_GetRoundNumber() : -1);
}

Old stuff would continue to work(because the stock is compiled into the plugin) and new stuff will use the updated stock that has this new feature. Downside is we need a new native to get the round number or something like that(might as well make War3_DealDamageDelayed a native?).
#war3source on gamesurge

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: Suggested check for War3_DealDamageDelayed
« Reply #3 on: April 15, 2016, 05:44:59 PM »
That's kinda what I was thinking overall, it SHOULD just be a native, I just don't have a dev environment setup to create and test it.

Edit: It should likely also be canceled when the target player dies.