Cokemonkey11
Spell Reviewer
- Joined
- May 9, 2006
- Messages
- 3,575
Hey guys, I have an issue with my map where computer players are able to force the cast of 1 ability "at the same time" as another one. I was unable to reproduce the problem myself, but a player I tested with (who had a 1/4s ping) was able to reproduce it.
So I've made my spell remove the other spell and then re-add it when it's finished its effect, but the issue still happens.
Any idea how to get around it?
Here's the spell they cast first -
Notice how it removes IMPALEID from the caster
So I've made my spell remove the other spell and then re-add it when it's finished its effect, but the issue still happens.
Any idea how to get around it?
Here's the spell they cast first -
JASS:
private function p takes nothing returns nothing
local unpauseDat tempDat
local integer index=0
loop
exitwhen index>dbIndex
set tempDat=unpauseDB[index]
set tempDat.timeLeft=tempDat.timeLeft-FIDELITY
if tempDat.timeLeft<=0 then
call UnitAddAbility(tempDat.u,IMPALEID)
call PauseUnit(tempDat.u,false)
call SetUnitTimeScale(tempDat.u,1)
set tempCasterX=GetUnitX(tempDat.u)
set tempCasterY=GetUnitY(tempDat.u)
call helper_sound3d(SLAMSOUND,tempCasterX,tempCasterY,GetUnitFlyHeight(tempDat.u))
set tempCaster=tempDat.u
call GroupEnumUnitsInRange(grp,tempCasterX,tempCasterY,SHOUTRANGE,Filter(function f))
set unpauseDB[index]=unpauseDB[dbIndex]
set dbIndex=dbIndex-1
if dbIndex==-1 then
call PauseTimer(time)
endif
call tempDat.destroy()
endif
set index=index+1
endloop
endfunction
private function c takes nothing returns boolean
local effect fx
local unpauseDat tempDat
if GetSpellAbilityId()==SHOUTID then
set tempDat=unpauseDat.create()
set tempDat.u=GetTriggerUnit()
set tempDat.timeLeft=PAUSETIME
set dbIndex=dbIndex+1
set unpauseDB[dbIndex]=tempDat
call UnitRemoveAbility(tempDat.u,IMPALEID)
if dbIndex==0 then
call TimerStart(time,FIDELITY,true,function p)
endif
set fx=AddSpecialEffect(SLAMMODEL,GetUnitX(tempDat.u),GetUnitY(tempDat.u))
call DestroyEffect(fx)
call SetUnitTimeScale(tempDat.u,2)
call IssueImmediateOrder(tempDat.u,"stop")
call PauseUnit(tempDat.u,true)
call SetUnitAnimationByIndex(tempDat.u,3)
endif
set fx=null
return false
endfunction
Notice how it removes IMPALEID from the caster