News:

Come Chat with us live! Learn how HERE!

Main Menu

Alternative Intermission - Problem with loading layout [SOLVED]

Started by WoGoMo, December 16, 2010, 08:52:31 PM

WoGoMo

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?
There is no sig...

Undeference

This is not the way to do it, in my opinion

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

Quote from: tuple on February 15, 2008, 11:54:10 PMThats what we need, helpful players, not more powerful admins.

WoGoMo

Quote from: man 3 strcasecmpThe  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...