ForLoopsBug

This is an example of the for-loop bug found in patch 2.0.10.

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of TheDestroyer01 TheDestroyer01 Aug 16, 2013 at 05:13 UTC - 0 likes

    This is the code:

    auto2218957F_ae = 5;
    auto2218957F_ai = 1;
    lv_x = 1;
    for ( ; ( (auto2218957F_ai >= 0 && lv_x <= auto2218957F_ae) || (auto2218957F_ai <= 0 && lv_x >= auto2218957F_ae) ) ; lv_x += auto2218957F_ai ) {
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, (StringExternal("Param/Value/7DE97036") + IntToText(lv_x)));
    }
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, (StringExternal("Param/Value/294008FC") + IntToText(lv_x)));
    return true;

    and it goes 1 2 3 4 5 6. Completely weird, I would have expected 1 2 3 4 5 5.


    Currently Developing Dungeon Explorer

  • Avatar of TheUltragon TheUltragon Aug 08, 2013 at 17:48 UTC - 0 likes

    Well, seems like the variables aren't set back to the previous value anymore after they were checked by the for-loop. And yes, your not crazy :D

  • 2 comments

Facts

Date created
Aug 07, 2013
Category
Last update
Aug 07, 2013
Development stage
Release
Language
  • enUS
License
Public Domain
Downloads
55
Recent file

Authors