Colobot Forum - International Colobot Community
Issue #641 - A bug or not? - Printable Version

+- Colobot Forum - International Colobot Community (https://colobot.info/forum)
+-- Forum: [Archive] New forum (2015-2019) (https://colobot.info/forum/forumdisplay.php?fid=76)
+--- Forum: Colobot: Gold Edition Development (https://colobot.info/forum/forumdisplay.php?fid=62)
+---- Forum: Game Engine & General Talk (https://colobot.info/forum/forumdisplay.php?fid=63)
+---- Thread: Issue #641 - A bug or not? (/showthread.php?tid=759)



Issue #641 - A bug or not? - Mrocza - 04-05-2016

The issue in question refers to build() exiting too early:

The following code outputs a value of about 0.29:

Code:
    build(ResearchCenter);
    point pos1 = position;
    wait(1);
    point pos2 = position;
    message(distance(pos1,pos2));

 
krzys-h stated as follows:
Quote:The values are different because the function exits as soon as brakes are enabled, but breaking takes some time. It works like that for all the functions in the game that don't slow down gracefully to increase precision (for example move does this, but goto does not), so I wouldn't consider this as a bug.


However it does not work like that for all the functions in the game that don't slow down gracefully to increase precision.
That is not true for move() as this code returns 0.00:
Code:
    move(-1);
    pos1 = position;
    wait(1);
    pos2 = position;
    message(distance(pos1,pos2));

In my humble opinion this is a bug in need of fixing as I've encountered situations where an inpropper distance evaluation due to this issue crashed my program. Otherwise I wouldn't have noticed it in the first place.
I'd love to see a few opinions on the topic.