Moved info_map_parameters into its own entity file, removed the old associated fields.
This commit is contained in:
parent
0e7fcf8012
commit
4f9e8c2a75
6 changed files with 42 additions and 24 deletions
|
@ -24,7 +24,6 @@
|
|||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
void Player_PreUpdate(void);
|
||||
void Player_ResetPrediction(void);
|
||||
|
||||
|
|
|
@ -125,7 +125,3 @@
|
|||
|
||||
/* light */
|
||||
.string pattern;
|
||||
|
||||
/* info_map_parameters */
|
||||
.float buying;
|
||||
.float bombradius;
|
||||
|
|
|
@ -339,21 +339,3 @@ void Rules_DeathCheck(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
SPAWN: info_map_parameters
|
||||
|
||||
Let map authors decide who can buy stuff and who CAN'T.
|
||||
Also allows people to set the bomb placing radius incase
|
||||
you want to use info_bomb_target.
|
||||
=================
|
||||
*/
|
||||
void info_map_parameters( void ) {
|
||||
if ( self.bombradius ) {
|
||||
iBombRadius = self.bombradius;
|
||||
}
|
||||
if ( self.buying ) {
|
||||
iBuyRestriction = self.buying;
|
||||
}
|
||||
}
|
||||
|
|
38
Source/Server/info_map_parameters.cpp
Normal file
38
Source/Server/info_map_parameters.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/***
|
||||
*
|
||||
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
|
||||
*
|
||||
* See the file LICENSE attached with the sources for usage details.
|
||||
*
|
||||
****/
|
||||
|
||||
class info_map_parameters
|
||||
{
|
||||
void() info_map_parameters;
|
||||
};
|
||||
|
||||
void info_map_parameters::info_map_parameters(void)
|
||||
{
|
||||
for (int i = 1; i < ( tokenize( __fullspawndata ) - 1 ); i += 2) {
|
||||
switch ( argv( i ) ) {
|
||||
case "bombradius":
|
||||
iBombRadius = stoi(argv(i + 1));
|
||||
#ifdef GS_DEVELOPER
|
||||
print(sprintf("info_map_parameters: Set C4 radius to %i\n", iBombRadius));
|
||||
#endif
|
||||
break;
|
||||
case "buying":
|
||||
iBuyRestriction = stoi(argv(i + 1));
|
||||
#ifdef GS_DEVELOPER
|
||||
print(sprintf("info_map_parameters: Set buy restriction to %i\n", iBuyRestriction));
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef GS_DEVELOPER
|
||||
remove(this);
|
||||
#endif
|
||||
}
|
|
@ -48,6 +48,9 @@ Money.c
|
|||
../Shared/spraylogo.cpp
|
||||
../Shared/pmove.c
|
||||
|
||||
|
||||
info_map_parameters.cpp
|
||||
|
||||
Vox.c
|
||||
Ammo.c
|
||||
Damage.c
|
||||
|
|
|
@ -18,7 +18,7 @@ void Sprite_AnimateThink( void ) {
|
|||
} else {
|
||||
self.frame += 1;
|
||||
}
|
||||
|
||||
|
||||
self.nextthink = time + ( 1 / self.framerate );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue