Moved info_map_parameters into its own entity file, removed the old associated fields.

This commit is contained in:
Marco Cawthorne 2019-01-04 21:58:19 +01:00
parent 0e7fcf8012
commit 4f9e8c2a75
6 changed files with 42 additions and 24 deletions

View file

@ -24,7 +24,6 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
void Player_PreUpdate(void);
void Player_ResetPrediction(void);

View file

@ -125,7 +125,3 @@
/* light */
.string pattern;
/* info_map_parameters */
.float buying;
.float bombradius;

View file

@ -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;
}
}

View 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
}

View file

@ -48,6 +48,9 @@ Money.c
../Shared/spraylogo.cpp
../Shared/pmove.c
info_map_parameters.cpp
Vox.c
Ammo.c
Damage.c

View file

@ -18,7 +18,7 @@ void Sprite_AnimateThink( void ) {
} else {
self.frame += 1;
}
self.nextthink = time + ( 1 / self.framerate );
}