Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Compiler Bugs?  (Read 2732 times)

0 Members and 1 Guest are viewing this topic.

greg

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
Compiler Bugs?
« on: September 24, 2006, 05:23:04 AM »

Hi Mnemonic,

I think I came across two bugs in the compiler:

1. The compiler (wme_comp.exe) complains when I use the following:

Code: [Select]
Game.SelectedItem.Name
However, it allows:

Code: [Select]
var SelItem = Game.SelectedItem;
SelItem.Name

Shouldn't Game.SelectedItem.Name be permitted?

2. In the following "if" statement...

Code: [Select]
if (SelItem != null && SelItem.GetHoverCursor() == null) ...

...if SelItem is null, shouldn't the conditional immediately evaluate to false, meaning (SelItem.GetHoverCursor() == null) would never be evaluated?

When I compile my game and run it, the console prints errors like crazy because it's trying to evaluate SelItem.GetHoverCursor() even when SelItem is null.

Thanks!  Please let me know if you need any additional information.

Greg

PS: For an Item object, what is the difference between the "standard" cursor and "Normal" cursor, e.g. Item.GetCursor() vs. Item.GetNormalCursor()?
PPS: Have you considered adding Item.{Has,Remove}{Normal,Hover}Cursor() to be consistent with Item.{Has,Remove}Cursor()?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Compiler Bugs?
« Reply #1 on: September 24, 2006, 05:59:03 PM »

These are known limitations of the script compiler, I'm afraid you'll have to live with them for the time being..

Quote
PS: For an Item object, what is the difference between the "standard" cursor and "Normal" cursor, e.g. Item.GetCursor() vs. Item.GetNormalCursor
All the game objects provide the cursor property, that is the mouse pointer being displayed when the mouse is hovered over them.
Inventory items are different, because they can act as mouse pointers themselves (when the item is selected). That's why they provide the additional Normal and Hover cursor properties (inactive/active item mouse pointer).

Quote
PPS: Have you considered adding Item.{Has,Remove}{Normal,Hover}Cursor() to be consistent with Item.{Has,Remove}Cursor()?
The HasCursor methods are obsolete, supercedded by GetCursor/GetCursorObject. The Remove* methods probably should be there, though..
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

greg

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
Re: Compiler Bugs?
« Reply #2 on: September 25, 2006, 06:03:29 AM »

Thanks!
Logged
 

Page created in 0.048 seconds with 23 queries.