GameMonkey Script
http://www.gmscript.com/gamemonkey/forum/

Bug - string operator not
http://www.gmscript.com/gamemonkey/forum/viewtopic.php?f=6&t=16
Page 1 of 1

Author:  Greg [ Mon Jan 19, 2004 8:41 am ]
Post subject:  Bug - string operator not

There is a bug in the string 'operator not' in GM versions including 1.1.

The function returns true instead of false. The correct code in gmOperators.cpp should be:

Code:
void GM_CDECL gmStringOpNOT(gmThread * a_thread, gmVariable * a_operands)
{
  a_operands->m_value.m_int = 0; a_operands->m_type = GM_INT;
}


Example script to demonstrate bug:
Code:
a = "apple";
if (!a)
{
  print("!a");  // This should not display but does
}

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/