scummvm debugger

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

User avatar
eriktorbjorn
ScummVM Developer
Posts: 3525
Joined: Mon Oct 31, 2005 7:39 am

Post by eriktorbjorn »

jumpjack wrote:Yes, but I think this IF structure lets argv[3] be used only if argc is DIFFERENT from 3! Or not? :?:
Well, you know argc is at least 3, because that's the first thing the function checks. So, to make up an example:

"object 42" - argc is 2, so it fails.
"object 42 pickup" - argc is 3, so it succeeds, using _vm->_currentRoom
"object 42 pickup 69" - argc is 4, so it succeeds, using argv[3], i.e. "69"

So I still don't see any problem.
jumpjack
Posts: 63
Joined: Tue May 23, 2006 8:21 am

Post by jumpjack »

eriktorbjorn wrote:
jumpjack wrote:Yes, but I think this IF structure lets argv[3] be used only if argc is DIFFERENT from 3! Or not? :?:
Well, you know argc is at least 3, because that's the first thing the function checks. So, to make up an example:

"object 42" - argc is 2, so it fails.
"object 42 pickup" - argc is 3, so it succeeds, using _vm->_currentRoom
"object 42 pickup 69" - argc is 4, so it succeeds, using argv[3], i.e. "69"

So I still don't see any problem.
ok, thanks, now I understand :wink:
Post Reply