![]() |
current Sourcecode
Hi everybody!
Just a Question: is the published Sourcecode a recent release? It doesn't compile because of two bugs in the grenade throwing code (bot.cpp) // We're done holding the Button (about to throw) ? if ((pBot->vecGrenade == g_vecZero) || (BotGetSafeTask (pBot)->fTime < gpGlobals->time) || (pEdict->v.weapons & (1 << CS_WEAPON_HEGRENADE) == 0)) (the second one is similar for Flashbang) Where can I get the latest sourcecode? |
Re: current Sourcecode
2.6mm Release #2.1
http://filebase.bots-united.com/pafi...on=file&id=103 |
Re: current Sourcecode
oh crap...
doesn't == go have a higher precedence than & ??? |
Re: current Sourcecode
Quote:
Use () to make the code OBVIOUS! |
Re: current Sourcecode
well I found out == does have a higher precedence..
so it would check if (1 << CS_WEAPON_GRENADE) is equal to 0 then AND it with pEdict->v.weapons.. I added parenthesis around so it looks like this: ((pEdict->v.weapons & (1<< CS_WEAPON_GRENADE)) == 0) and you said knowing anything other than operator precedence is a waste... meaning if someone knew about everything else except for operator precedence it is a waste meaning everyone must know all about operator precedence or it is a waste.. [edit] I just copied the operator precedence table out of "The C++ Programming Language: Special Edition" for an easier reference :D http://www.mapzap.org/op.html [/edit] |
Re: current Sourcecode
@g4s Thx! (bug's still in it)
@sPlOrYgOn it does. The point is using three arguments with the || operator. My compiler (MS vcpp.net) wants to see only two arguments in a funktion with this operator... (don't get me wrong. I'm not teaching you. I'm a bloody noob with c++) so it issues a warning and doesn't compile. oops! Me to slow answering! gona try out your changes. |
Re: current Sourcecode
I use GCC 2.95.3 and 3.3 and VC++ 6 and all of them don't give me any warning like that...
|
Re: current Sourcecode
Quote:
As a matter of fact: The change you propose did the job! No errors no warnings! Super! Now I got something to start with. Thanks alot mate! You know your business! |
All times are GMT +2. The time now is 07:45. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.