[FIXED] `CommandWindow.print(...)` - Broken Formatting + Crashes

Issue Summary:

Since patch 1.6 CommandWindow.print(...) tries to concatenate passed parameters without converting them to string first and without appending '\n' at the end which results in:

  1. Ugly formatting (No line breaks)
  2. Crashes (if one of the parameters is neither string nor number)

Steps to Reproduce:

  1. CommandWindow.print("My", "message", false)

Results in:

> <<Crash>>Access violation (0xc0000005) in build 8462f992ef28
> accessing address 0000000000000000 from 00007FF67792B67F <</Crash>>

Expected behavior:

> My message false

(Formatting just like in regular print function.)


From within the Lua level can be fixed with an ugly hack:

  local console_message = {...}
  for i, element in ipairs(console_message) do
    console_message[i] = tostring(element)
  end
  table.insert(console_message, '\n')
  CommandWindow.print(table.concat(console_message, " "))
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.