Raised This Month: $ Target: $400
 0% 

activating ents


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
TiToTal
Member
Join Date: Feb 2006
Old 03-05-2006 , 11:00  
Reply With Quote #5

Quote:
Originally Posted by PM
The if instead of while question:

Well, you _could_ do this:
Code:
new entid = -1 while (true) {    entid = find_ent_by_tname(entid, "door")    if (!entid) // entid zero!      break;  // stop loop    force_use(id, entid) }

But I don't like it

Yeah, I definitely don't like it too... hehe


Quote:
Originally Posted by PM
I think the code is right as I've written it; (you can test it by running it, the warning doesn't prevent code generation). To prevent the warning, you can either try to wrap the assignment in extra parenthesis; if that doesn't silence the compiler, you could try rewriting the line of code to this:
Code:
while ((entid = find_ent_by_tname(entid, "door")) != 0)

Man, you're very good at it... Now, I believe the code is completely right like you, lol, and the extra "()" worked exactly as you said it would be...

It is perfect... Thanks once more... My tutor hehehe...
TiToTal is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode