command-and-conquer icon indicating copy to clipboard operation
command-and-conquer copied to clipboard

Get full unit life at empty bar

Open ajira86 opened this issue 13 years ago • 3 comments

I was attacking two turrets and one of my tank becom full of life after loosing all in progress bar. After that, he continue to run like a fresh tank

ajira86 avatar Jan 26 '12 13:01 ajira86

Wow... this one is new.... I'll check the code to see if I can find out whats happening....

However this one is going to be hard to replicate :(

adityaravishankar avatar Jan 26 '12 14:01 adityaravishankar

line 1203: [code] var vehicle = vehicles.add({name:unitButton.name,x:constructedAt.x+1, y:constructedAt.y + 3,moveDirection:16,turretDirection:16, orders:{type:'move',to:{x:Math.floor(constructedAt.x-1+ (Math.random()*4)), // orders:{type:'move',to:{x:Math.floor(constructedAt.x-1), y:Math.floor(constructedAt.y+5)}}}); game.units.push(vehicle);
[/code]

Could it be that by accident 2 tanks are create on the same coordinates? so when you move they move together and or not detected using the 'tanks move for each other' algorithm? So if that could happen and they both move the same way thereby drawn the same way, when 1 tank is destroyed it will be removed but the other tank is still present?

jovoud avatar Jan 27 '12 17:01 jovoud

Don't think so....

The second tank would avoid the first tank because of the collision-radius intersection... So it would turn away before getting near the first tank...

adityaravishankar avatar Jan 27 '12 18:01 adityaravishankar