Server Help

Bot Questions - Warning:

The Arctica - Tue May 17, 2005 3:56 am
Post subject: Warning:
Ehhh, how can i get this warning away ?

Code: Show/Hide
bool getTurret(String player, String turret, int posx, int posy)
   {
      Turret *t;
      if (t->name == player)
      {
         if (turret == lvl1_1)
         {
            if ( (posx / 16) > 311 && (posx / 16) < 315 && (posy / 16) > 317 && (posy / 16) < 321)
            {
               t->tur = turret;
               return true;
            }
            return false;
         }
      }
      t->name = player;
      t->tur = turret;

      return true;
   }


Alright it says :
Quote:
d:\mervbot\src\master\spawn.h(42) : warning C4700: local variable 't' used without having been initialized

Maverick - Tue May 17, 2005 4:05 am
Post subject: Re: Warning:
Code: Show/Hide

Turret *t;
      if (t->name == player)
      {
         


The problem is that you are declaring the variable Turret *t, but never initialized it with a default value.
In the if() statement you are trying to use the variable though.

Look in the constructor of the class Turret on how to initialize the t variable.
50% Packetloss - Tue May 17, 2005 1:04 pm
Post subject:
Maybe learn C++. Inorder to write/understand a language you first have to learn it, otherwise you are just a script kiddy.
The Arctica - Tue May 17, 2005 3:42 pm
Post subject:
im trying to learn, not easy tho, im just 14 years icon_wink.gif, found the problem, had to be Turret ; and then strcpy(t.name, player)
do you know a good website to learn C++ ?
Thanks.

-Arctica
The Arctica - Tue May 17, 2005 3:43 pm
Post subject:
im trying to learn, not easy tho, im just 14 years icon_wink.gif, found the problem, had to be Turret ; and then strcpy(t.name, player)
do you know a good website to learn C++ ?
Thanks.

-Arctica
D1st0rt - Tue May 17, 2005 4:56 pm
Post subject:
I recommend this site:

http://computer.howstuffworks.com/c.htm

I'm guessing most of the things you're doing in c++ can be done with C anyways, and this one has good illustrating pictures and doesn't use cout biggrin.gif
Solo Ace - Tue May 17, 2005 5:12 pm
Post subject:
d1st0rt = realloc(d1st0rt, NULL);

INSERT INTO d1st0rt.nose
VALUES ('hammer');

mount /dev/spoon /home/d1st0rt/ears
50% Packetloss - Wed May 18, 2005 3:18 am
Post subject:
If you are trying to learn a language, you usually don't start by writting a novel in the language you don't even know yet. Mervbot is not something you should be involved in until you completely understand the language.
D1st0rt - Wed May 18, 2005 8:07 pm
Post subject:
Solo, the relevance of that post divided by your sense of humor is NaN biggrin.gif
Mr Ekted - Wed May 18, 2005 9:12 pm
Post subject:
Now THIS is a fun thread! icon_smile.gif
Cyan~Fire - Fri May 20, 2005 5:19 pm
Post subject:
Code: Show/Hide
void makeFun(Thread *t)
{
   CloseHandle(SoloAce);
   t->fun++;
}


Use C++.com silly geese.
Mr Ekted - Fri May 20, 2005 5:28 pm
Post subject:
*cough*

Code: Show/Hide
void Thread::makeFun ()
{
CloseHandle(SoloAce);
m_fun++;
}

Solo Ace - Fri May 20, 2005 5:43 pm
Post subject:
Hah.

I'M A PERSISTENT OBJECT, DENIED.

~CyanFire(); THAT'S WHAT YOUR NAME SHOULD BE.

Yay, this thread should win the MGB's forums nerd award.
Solo Ace - Fri May 20, 2005 5:47 pm
Post subject:
Code: Show/Hide
#!/usr/bin/env python
# This is the source to Ekted, some newbie

import os

ekted = 'ekted'
run = "echo %s > /dev/null" % ekted

os.system(run)

D1st0rt - Sat May 21, 2005 1:22 pm
Post subject:
Code: Show/Hide
#!/usr/bin/env python
# This is the source to Solo Ace

import ohnoes

SoloAce = 'PENGUIN!!rofl'
os.system(EXPLODE4win!)

Solo Ace - Sat May 21, 2005 2:16 pm
Post subject:
icon_surprised.gif
Code: Show/Hide
blah@xs3:~% ./d1st0rt.py
  File "./d1st0rt.py", line 7
    os.system(EXPLODE4win!)
                         ^
SyntaxError: invalid syntax


GG.

Don't you dare to whine about my "./", I'm not root there anyway!
Maverick - Sat May 21, 2005 3:24 pm
Post subject:
*cough* nerds *cough*
D1st0rt - Sat May 21, 2005 4:53 pm
Post subject:
That would be great if I had been trying for valid syntax biggrin.gif
Cyan~Fire - Sat May 21, 2005 5:54 pm
Post subject:
Man, Ekted. And I even wrote C just for you!
2dragons - Mon May 23, 2005 3:15 am
Post subject:
Bleh you nerds! icon_eek.gif
Cyan~Fire - Mon May 23, 2005 11:54 am
Post subject:
Java infidel.
D1st0rt - Mon May 23, 2005 4:49 pm
Post subject:
Hey, watch yourself. Our collective has a greater capacity to annoy and enrage you than you can handle.
Cyan~Fire - Mon May 23, 2005 5:15 pm
Post subject:
Don't worry, I know. Just search for "Java AND c++" on this forum and you'll see my learning experience. icon_biggrin.gif
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group