Author Topic: Alternative Intermission - Problem with loading layout [SOLVED]  (Read 4121 times)

WoGoMo

  • Posts: 95
  • Turrets: +6/-6
Alternative Intermission - Problem with loading layout [SOLVED]
« on: December 16, 2010, 08:52:31 pm »
With reference to the following threads:

http://tremulous.net/forum/index.php?topic=14621.msg211407
http://tremulous.net/forum/index.php?topic=14799.0

I came up with some code changes to try and add the desired functionality to tremded vm. The patch can be downloaded from http://sirclan.no-ip.org/wogomo/wogomo.patch which is a diff against the latest gpp branch from svn.

Commands /alienint, /humanint, and /specint all work fine as long as u have the admin privileges and it seems to change the intermission in a running game correctly. /layoutsave also writes the correct data to the layoutfile. However, upon loading a map with the custom layout, both aliens and specs are getting the spec intermission while humans are getting the alien intermission. FAIL!

Cant figure out what I did wrong. Can someone help me?
« Last Edit: December 16, 2010, 10:20:53 pm by WoGoMo »
There is no sig...

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Re: Alternative Intermission - Problem with loading layout
« Reply #1 on: December 16, 2010, 09:02:53 pm »
This is not the way to do it, in my opinion

Code: [Select]
+ if( Q_stricmp( buildName, "alienint" ) )

+ else if( Q_stricmp( buildName, "humanint" ) )

+ else if( Q_stricmp( buildName, "specint" ) )

+ if( Q_stricmp( buildName, "alienint" ) || Q_stricmp( buildName, "humanint" ) || Q_stricmp( buildName, "specint" ) )
Quote from: man 3 strcasecmp
       The  strcasecmp() function compares the two strings s1 and s2, ignoring
       the case of the characters.  It returns an integer less than, equal to,
       or  greater than zero if s1 is found, respectively, to be less than, to
       match, or be greater than s2.
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

WoGoMo

  • Posts: 95
  • Turrets: +6/-6
Re: Alternative Intermission - Problem with loading layout
« Reply #2 on: December 16, 2010, 09:53:35 pm »
Quote from: man 3 strcasecmp
       The  strcasecmp() function compares the two strings s1 and s2, ignoring
       the case of the characters.  It returns an integer less than, equal to,
       or  greater than zero if s1 is found, respectively, to be less than, to
       match, or be greater than s2.

OMG. I've not been coding in C for such a long time I totally forgot about this. Thanks.
There is no sig...