Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1380287 into lp:widelands

2015-03-12 Thread GunChleoc
I forgot that in this direction, it is better to use a switch statement. Something I learned from SirVer - the code will run faster, because it just jumps using the variable as an address instead of making a full comparison. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1380287/+mer

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1380287 into lp:widelands

2015-03-12 Thread TiborB
This is the easier conversion, but I need also backward conversion... But it seems there is also example for this I will look at it once more... -- https://code.launchpad.net/~widelands-dev/widelands/bug-1380287/+merge/252507 Your team Widelands Developers is requested to review the proposed

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1380287 into lp:widelands

2015-03-12 Thread GunChleoc
I just had a very quick look and it seems to be OK overall - I will have to look at the code properly. One thing though: it might be better to have strings rather than numbers in Lua for the scouting direction. Operating on the pure numbers will make the code hard to read, and also break the cod