Merge remote-tracking branch 'suokko/console_math_error_fix' into develop

Also update changelog
develop
lethosor 2018-07-09 09:20:38 -04:00
commit 6a76631375
2 changed files with 7 additions and 3 deletions

@ -37,6 +37,9 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
================================================================================ ================================================================================
# Future # Future
## Fixes
-@ Console: fixed crash when entering commands on Linux/macOS
================================================================================ ================================================================================
# 0.44.12-alpha1 # 0.44.12-alpha1

@ -486,9 +486,10 @@ namespace DFHack
int cooked_cursor = raw_cursor; int cooked_cursor = raw_cursor;
if ((plen+cooked_cursor) >= cols) if ((plen+cooked_cursor) >= cols)
{ {
begin = plen+cooked_cursor-cols-1; const int text_over = plen + cooked_cursor + 1 - cols;
len -= plen+cooked_cursor-cols-1; begin = text_over;
cooked_cursor -= plen+cooked_cursor-cols-1; len -= text_over;
cooked_cursor -= text_over;
} }
if (plen+len > cols) if (plen+len > cols)
len -= plen+len - cols; len -= plen+len - cols;