fix bug reported by Salius

For more details about the bug, please refer to:
http://landoffire.org/forum/viewtopic.php?f=16&t=1472