Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Small bug in the source  (Read 740 times)

worthstream

  • Escaped Lunatic
    • View Profile
Small bug in the source
« on: May 12, 2011, 09:11:01 am »

Sorry if i'm not checking it in the sourceforge SVN, but i'm at work and browsing the code on the web.
I found a small bug in the code, we're checking stealth against prisoners by type and not by name:

in /src/sitemode/stealth.cpp

on line 204 there is

204                 if(encounter[e].type==CREATURE_PRISONER)continue;

but as stated in line 105 and later:

105                 //if(encounter[e].type==CREATURE_PRISONER)continue;
106           
107                 // ...but Prisoners are now spawned with a variety of creature
108                 // types, so we'll go by name instead
109                 if(!strcmp(encounter[e].name,"Prisoner"))continue;

so it sould be
204                 if(!strcmp(encounter[e].name,"Prisoner"))continue;
Logged

Kay12

  • Bay Watcher
  • Fighting for Elite Liberal values since 2009!
    • View Profile
Re: Small bug in the source
« Reply #1 on: May 16, 2011, 01:51:25 am »

Another one that prevents compiling - I'm not sure why, but there's an odd assignment in activities.cpp that prevents compiling (at least for me)...

Code: [Select]
2470 //SECURITY?
2471 char alarmon=0;
2472 char sensealarm=0;
2473 if(LCSrandom(100)<v->sensealarmchance()) sensealarm=1;
2474 char touchalarm=0;
2475 if(LCSrandom(100)<v->touchalarmchance()) touchalarm=1;
2476 char windowdamage=08;

windowdamage=08... the zero causes it to be interpreted as an octal number, and the eight after it causes the compiler to have a bad day, if I've understood correctly.

It was committed recently (http://lcsgame.svn.sourceforge.net/viewvc/lcsgame/trunk/src/daily/activities.cpp?r1=499&r2=500) with no other actual code changes, so I think it's intended to do something. I've changed my working copy back to plain ol' 0 though.
Logged
Try Liberal Crime Squad, an excellent Liberal Crime adventure game by Toady One and the open source community!
LCS in SourceForge - LCS Wiki - Forum thread for 4.04

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: Small bug in the source
« Reply #2 on: May 16, 2011, 02:59:30 pm »

It was committed recently (http://lcsgame.svn.sourceforge.net/viewvc/lcsgame/trunk/src/daily/activities.cpp?r1=499&r2=500) with no other actual code changes, so I think it's intended to do something. I've changed my working copy back to plain ol' 0 though.

I can't see what the purpose of this could have been. Windows should start out undamaged. Feel free to commit the change back to just 0.
Logged