its a great idea but very buggy...
also a little thing that makes it weird... the name of future self is not same as ur hero....he get a name change in 2 seconds?
I, uhhh, didn't even think about this. Maybe I'll use a CloneUnit function instead of creating a new hero from scratch... if and when I ever update this spell to be proper.mastah_ said:also a little thing that makes it weird... the name of future self is not same as ur hero....he get a name change in 2 seconds?
//offtopicYou are a dirty stinking alien hiding in a human body.
Don't think for a second that I don't know you have a vJass co-processor inserted in your neural cortex.
And the fact you know just a little too much about quantum physics is not helping your cover either.
// User Vars
globals
integer X
integer Y
end
// Self initialized
globals
integer countIndex= 0
integer countInfo = 0
integer array Index
integer firstFree = -1
integer array Free
end
function Alloc( nothing ): integer
integer this
integer info
if firstFree == - 1 then
countIndex += 1 // min index needs to be 0 for null struct
this = countIndex
else
this = firstFree
firstFree = Free[ firstFree ]
end
info = countInfo
countInfo += 1
Index[ this ] = info
// Set vars...
X[ info ] = 0
Y[ info ] = 0
// ...
return this
end
function Destroy( integer this ): nothing
integer info = Index[ this ]
integer oldInfo = Index[ countIndex ]
Free[ this ] = firstFree
firstFree = this
Index[ countIndex ] = info
// Set vars...
X[ info ] = X[ oldInfo ]
Y[ info ] = Y[ oldInfo ]
// ...
countInfo -= 1
end