.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Releases, Installers, Docs & Coding (http://forums.bots-united.com/forumdisplay.php?f=48)
-   -   current Sourcecode (http://forums.bots-united.com/showthread.php?t=1822)

Abu Amok 31-05-2004 11:13

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?

g4s 31-05-2004 12:54

Re: current Sourcecode
 
2.6mm Release #2.1
http://filebase.bots-united.com/pafi...on=file&id=103

sPlOrYgOn 31-05-2004 15:50

Re: current Sourcecode
 
oh crap...
doesn't == go have a higher precedence than & ???

Austin 31-05-2004 18:58

Re: current Sourcecode
 
Quote:

Originally Posted by sPlOrYgOn
oh crap...
doesn't == go have a higher precedence than & ???

I don't know and I don't care. Knowing anythign other then basic precedence is a waste.

Use () to make the code OBVIOUS!

sPlOrYgOn 31-05-2004 19:05

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]

Abu Amok 31-05-2004 19:10

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.

sPlOrYgOn 31-05-2004 19:14

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...

Abu Amok 31-05-2004 19:25

Re: current Sourcecode
 
Quote:

Originally Posted by sPlOrYgOn
I use GCC 2.95.3 and 3.3 and VC++ 6 and all of them don't give me any warning like that...

I never said that the one i use is a good one;)

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.