* May 23, 2013, 01:58:02 PM
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Come Chat with us live! Learn how HERE!
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Alternative Intermission - Problem with loading layout [SOLVED]  (Read 382 times)
WoGoMo


Turrets: +5/-5
Posts: 84


« 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 » Logged

There is no sig...
Undeference
Tremulous Developers
*

Turrets: +122/-45
Posts: 1207


Ingar and carry on.


WWW
« Reply #1 on: December 16, 2010, 09:02:53 PM »

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

Code:
+ 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.
Logged

Need help? Ask intelligently. If you find a solution on your own, please share it so others can benefit.

Thats what we need, helpful players, not more powerful admins.
Looking for more Tremulous maps?
WoGoMo


Turrets: +5/-5
Posts: 84


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

There is no sig...
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TremPlus theme by Ingar, based on AF316 theme by Fedhog
Valid XHTML 1.0! Valid CSS!