Closed jakwings closed 5 years ago
Nice!
Awesome. So they only rotate if thrown?
Yes, only when thrown/blown/kicked up. And reset when picked up.
The problem is basically caused by uninitialized values.
I would like to add a minor thing you may have perceived (at least prior to this pr): after some items are thrown, after they rotate, the final rotation is not kept on next turn. So whenever you step again, that item will "become alive" and 1/4 spin (one spin step) again.
I think the rotation could be reset after thrown, no matter what spin step it was, just to prevent that glitch. I havent tested this merge yet to see if affected that.
That isn't fixed yet.
if(ivanconfig::GetRotateTimesPerSquare()>0 && iRotateFlyingThrownStep!=0){ //must be disabled before exiting Fly()
iRotateFlyingThrownStep=4; //default rotation is w/o the rotation flags at the switch(){}
//force redraw at default rotation to avoid another spin when player moves TODO how to let it stay in the last rotation?
RemoveFromSlot();LandingSquare->GetStack()->AddItem(this, false); //TODO find a better way then remove and re-add to same square...
game::DrawEverything();
iRotateFlyingThrownStep=0; //disables rotation
}
You mean this? So your solution was already there but the bug made me think the rotation should not be reset.
Now the solution is either to clean up some code from my commit and add this:
while(clock() - StartTime < fFlyDelay * CLOCKS_PER_SEC);
game::DrawEverything();
or remove that line:
iRotateFlyingThrownStep=0; //disables rotation
while(clock() - StartTime < fFlyDelay * CLOCKS_PER_SEC);
game::DrawEverything();
mmm... I cant recall it, but apparently it worked then, but not as often as it should be (always). so with that code, it would wait a tiny bit and apply the fix. if it works, would be great! :)
obs.: I think not disabling the rotation caused other problems.
No rotated pictures for equipments and newly-spawned items.