Argh!
https://git.do.srb2.org/haya_/Kart-Public/-/commit/217f15452c1fda9ea3c0d00650d470e13e14e0f5
This commit is contained in:
1 parent
43e1331594
commit
76b66b41b6
9 files changed
+112
-114
No files matched your search
@@ -3,6 +3,7 @@
|
||||
# Core sources
|
||||
set(SRB2_CORE_SOURCES
|
||||
am_map.c
|
||||
args.c
|
||||
b_bot.c
|
||||
command.c
|
||||
comptime.c
|
||||
@@ -52,6 +53,7 @@ set(SRB2_CORE_SOURCES
|
||||
|
||||
set(SRB2_CORE_HEADERS
|
||||
am_map.h
|
||||
args.h
|
||||
b_bot.h
|
||||
byteptr.h
|
||||
command.h
|
||||
|
||||
+24
-24
@@ -1,4 +1,4 @@
|
||||
#include "doomtype.h"
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -106,7 +106,7 @@ static void vec_free(Vec* vec) {
|
||||
}
|
||||
|
||||
|
||||
static boolean vec_add(Vec* vec, void* entry) {
|
||||
static bool vec_add(Vec* vec, void* entry) {
|
||||
if (vec->count + 1 > vec->capacity) {
|
||||
int new_capacity = vec->capacity < 8 ? 8 : vec->capacity * 2;
|
||||
void** new_array = realloc(vec->entries, sizeof(void*) * new_capacity);
|
||||
@@ -191,7 +191,7 @@ static MapEntry* map_find(Map* map, const char* key, uint32_t key_hash) {
|
||||
}
|
||||
|
||||
|
||||
static boolean map_grow(Map* map) {
|
||||
static bool map_grow(Map* map) {
|
||||
MapEntry* old_entries = map->entries;
|
||||
int old_capacity = map->capacity;
|
||||
int new_capacity = old_capacity < 8 ? 8 : old_capacity * 2;
|
||||
@@ -227,7 +227,7 @@ static boolean map_grow(Map* map) {
|
||||
|
||||
|
||||
// Returns true if the key was found.
|
||||
static boolean map_get(Map* map, const char* key, void** value) {
|
||||
static bool map_get(Map* map, const char* key, void** value) {
|
||||
if (map->count == 0) return false;
|
||||
|
||||
uint32_t key_hash = str_hash(key);
|
||||
@@ -241,7 +241,7 @@ static boolean map_get(Map* map, const char* key, void** value) {
|
||||
|
||||
// Adds a new entry to the map or updates the value of an existing entry.
|
||||
// (Note that the map stores its own internal copy of the key string.)
|
||||
static boolean map_set(Map* map, const char* key, void* value) {
|
||||
static bool map_set(Map* map, const char* key, void* value) {
|
||||
if (map->count == map->max_load_threshold) {
|
||||
if (!map_grow(map)) {
|
||||
return false;
|
||||
@@ -269,7 +269,7 @@ static boolean map_set(Map* map, const char* key, void* value) {
|
||||
|
||||
// Convenience wrapper for map_set(). This splits the key string into space-
|
||||
// separated words and adds a separate entry to the map for each word.
|
||||
static boolean map_set_splitkey(Map* map, const char* key_string, void* value) {
|
||||
static bool map_set_splitkey(Map* map, const char* key_string, void* value) {
|
||||
char *copy_of_key_string = str_dup(key_string);
|
||||
if (!copy_of_key_string) {
|
||||
return false;
|
||||
@@ -343,7 +343,7 @@ static void option_free(Option* opt) {
|
||||
}
|
||||
|
||||
|
||||
static boolean option_append_value(Option* opt, OptionValue value) {
|
||||
static bool option_append_value(Option* opt, OptionValue value) {
|
||||
if (opt->count + 1 > opt->capacity) {
|
||||
int new_capacity = opt->capacity < 4 ? 4 : opt->capacity * 2;
|
||||
OptionValue* new_array = realloc(opt->values, sizeof(OptionValue) * new_capacity);
|
||||
@@ -359,7 +359,7 @@ static boolean option_append_value(Option* opt, OptionValue value) {
|
||||
}
|
||||
|
||||
|
||||
static boolean option_try_set(Option* opt, char* arg) {
|
||||
static bool option_try_set(Option* opt, char* arg) {
|
||||
if (opt->type == OPT_STR) {
|
||||
return option_append_value(opt, (OptionValue){.str_val = arg});
|
||||
}
|
||||
@@ -579,7 +579,7 @@ static char* argstream_next(ArgStream* stream) {
|
||||
}
|
||||
|
||||
|
||||
static boolean argstream_has_next(ArgStream* stream) {
|
||||
static bool argstream_has_next(ArgStream* stream) {
|
||||
return stream->index < stream->count;
|
||||
}
|
||||
|
||||
@@ -600,10 +600,10 @@ struct ArgParser {
|
||||
ap_callback_t callback;
|
||||
char* cmd_name;
|
||||
struct ArgParser* cmd_parser;
|
||||
boolean enable_help_command;
|
||||
boolean had_memory_error;
|
||||
bool enable_help_command;
|
||||
bool had_memory_error;
|
||||
struct ArgParser* parent;
|
||||
boolean first_positional_arg_ends_options;
|
||||
bool first_positional_arg_ends_options;
|
||||
};
|
||||
|
||||
|
||||
@@ -748,7 +748,7 @@ char* ap_get_version(ArgParser* parser) {
|
||||
}
|
||||
|
||||
|
||||
void ap_first_pos_arg_ends_options(ArgParser* parser, boolean enable) {
|
||||
void ap_first_pos_arg_ends_options(ArgParser* parser, bool enable) {
|
||||
parser->first_positional_arg_ends_options = enable;
|
||||
}
|
||||
|
||||
@@ -832,7 +832,7 @@ int ap_count(ArgParser* parser, const char* name) {
|
||||
|
||||
|
||||
// Returns true if the specified flag or option was found.
|
||||
boolean ap_found(ArgParser* parser, const char* name) {
|
||||
bool ap_found(ArgParser* parser, const char* name) {
|
||||
Option* opt = ap_get_opt(parser, name);
|
||||
return opt->count > 0;
|
||||
}
|
||||
@@ -913,7 +913,7 @@ double* ap_dbl_values(ArgParser* parser, const char* name) {
|
||||
|
||||
|
||||
// Returns true if the parser has found one or more positional arguments.
|
||||
boolean ap_has_args(ArgParser* parser) {
|
||||
bool ap_has_args(ArgParser* parser) {
|
||||
return parser->positional_args->count > 0;
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ void ap_callback(ArgParser* parser, ap_callback_t function) {
|
||||
|
||||
|
||||
// Returns true if the parser has found a command.
|
||||
boolean ap_has_cmd(ArgParser* parser) {
|
||||
bool ap_has_cmd(ArgParser* parser) {
|
||||
return parser->cmd_name != NULL;
|
||||
}
|
||||
|
||||
@@ -1034,7 +1034,7 @@ ArgParser* ap_cmd_parser(ArgParser* parser) {
|
||||
|
||||
|
||||
// Toggles support for the automatic 'help' command.
|
||||
void ap_enable_help_command(ArgParser* parser, boolean enable) {
|
||||
void ap_enable_help_command(ArgParser* parser, bool enable) {
|
||||
parser->enable_help_command = enable;
|
||||
}
|
||||
|
||||
@@ -1056,7 +1056,7 @@ static void ap_handle_equals_opt(ArgParser* parser, const char* prefix, const ch
|
||||
char *value = strchr(arg, '=') + 1;
|
||||
|
||||
Option* option;
|
||||
boolean found = map_get(parser->option_map, name, (void**)&option);
|
||||
bool found = map_get(parser->option_map, name, (void**)&option);
|
||||
|
||||
if (!found || option->type == OPT_FLAG) {
|
||||
err(va("%s%s is not a recognised option name", prefix, name));
|
||||
@@ -1101,7 +1101,7 @@ static void ap_handle_short_opt(ArgParser* parser, const char* arg, ArgStream* s
|
||||
for (size_t i = 0; i < strlen(arg); i++) {
|
||||
char keystr[] = {arg[i], 0};
|
||||
Option* option;
|
||||
boolean found = map_get(parser->option_map, keystr, (void**)&option);
|
||||
bool found = map_get(parser->option_map, keystr, (void**)&option);
|
||||
if (!found) {
|
||||
if (arg[i] == 'h' && parser->helptext != NULL) {
|
||||
CONS_Printf("%s\n", parser->helptext);
|
||||
@@ -1134,7 +1134,7 @@ static void ap_parse_stream(ArgParser* parser, ArgStream* stream) {
|
||||
}
|
||||
|
||||
ArgParser* cmd_parser;
|
||||
boolean is_first_arg = true;
|
||||
bool is_first_arg = true;
|
||||
|
||||
while (argstream_has_next(stream)) {
|
||||
char* arg = argstream_next(stream);
|
||||
@@ -1216,7 +1216,7 @@ static void ap_parse_stream(ArgParser* parser, ArgStream* stream) {
|
||||
|
||||
|
||||
// Parse an array of string arguments.
|
||||
static boolean ap_parse_array(ArgParser* parser, int count, char* args[]) {
|
||||
static bool ap_parse_array(ArgParser* parser, int count, char* args[]) {
|
||||
if (parser->had_memory_error) {
|
||||
return false;
|
||||
}
|
||||
@@ -1237,7 +1237,7 @@ static boolean ap_parse_array(ArgParser* parser, int count, char* args[]) {
|
||||
// are the arguments passed to main(), i.e. that the first element in [argv] is the program's name
|
||||
// and should be ignored when parsing the actual *arguments*. In some situations [argv] can be
|
||||
// empty, i.e. [argc == 0], which can lead to security vulnerabilities if not explicitly handled.
|
||||
boolean ap_parse(ArgParser* parser, int argc, char* argv[]) {
|
||||
bool ap_parse(ArgParser* parser, int argc, char* argv[]) {
|
||||
if (argc > 1) {
|
||||
return ap_parse_array(parser, argc - 1, argv + 1);
|
||||
}
|
||||
@@ -1250,7 +1250,7 @@ boolean ap_parse(ArgParser* parser, int argc, char* argv[]) {
|
||||
/* --------------------- */
|
||||
|
||||
|
||||
boolean ap_had_memory_error(ArgParser* parser) {
|
||||
bool ap_had_memory_error(ArgParser* parser) {
|
||||
return parser->had_memory_error;
|
||||
}
|
||||
|
||||
@@ -1294,7 +1294,7 @@ void ap_print(ArgParser* parser) {
|
||||
/* --------------------- */
|
||||
|
||||
|
||||
void ap_cmd_help(ArgParser* parser, boolean enable) {
|
||||
void ap_cmd_help(ArgParser* parser, bool enable) {
|
||||
ap_enable_help_command(parser, enable);
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -8,7 +8,7 @@
|
||||
#ifndef args_h
|
||||
#define args_h
|
||||
|
||||
#include "doomtype.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Types.
|
||||
@@ -51,7 +51,7 @@ char* ap_get_version(ArgParser* parser);
|
||||
|
||||
// If toggled to true, the first positional argument ends option parsing; all
|
||||
// subsequent arguments will be treated as positionals. Defaults to false.
|
||||
void ap_first_pos_arg_ends_options(ArgParser* parser, boolean enable);
|
||||
void ap_first_pos_arg_ends_options(ArgParser* parser, bool enable);
|
||||
|
||||
// Parses the application's command line arguments. The parameters are assumed
|
||||
// to be [argc] and [argv] as supplied to main(), i.e. the first element of the
|
||||
@@ -59,7 +59,7 @@ void ap_first_pos_arg_ends_options(ArgParser* parser, boolean enable);
|
||||
// if the arguments were successfully parsed. Returns false if parsing failed
|
||||
// due to a memory allocation error. (This memory allocation error may have
|
||||
// occured during set-up rather than during parsing.)
|
||||
boolean ap_parse(ArgParser* parser, int argc, char** argv);
|
||||
bool ap_parse(ArgParser* parser, int argc, char** argv);
|
||||
|
||||
// Frees the memory associated with the parser and any subparsers.
|
||||
void ap_free(ArgParser* parser);
|
||||
@@ -88,7 +88,7 @@ void ap_dbl_opt(ArgParser* parser, const char* name, double fallback);
|
||||
int ap_count(ArgParser* parser, const char* name);
|
||||
|
||||
// Returns true if the specified flag or option was found.
|
||||
boolean ap_found(ArgParser* parser, const char* name);
|
||||
bool ap_found(ArgParser* parser, const char* name);
|
||||
|
||||
// Returns the value of a string option.
|
||||
char* ap_str_value(ArgParser* parser, const char* name);
|
||||
@@ -128,7 +128,7 @@ double* ap_dbl_values(ArgParser* parser, const char* name);
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Returns true if the parser has found one or more positional arguments.
|
||||
boolean ap_has_args(ArgParser* parser);
|
||||
bool ap_has_args(ArgParser* parser);
|
||||
|
||||
// Returns the number of positional arguments.
|
||||
int ap_count_args(ArgParser* parser);
|
||||
@@ -166,7 +166,7 @@ ArgParser* ap_cmd(ArgParser* parser, const char* name);
|
||||
void ap_callback(ArgParser* parser, ap_callback_t function);
|
||||
|
||||
// Returns true if the parser has found a command.
|
||||
boolean ap_has_cmd(ArgParser* parser);
|
||||
bool ap_has_cmd(ArgParser* parser);
|
||||
|
||||
// Returns the command name, if the parser has found a command.
|
||||
char* ap_cmd_name(ArgParser* parser);
|
||||
@@ -174,11 +174,11 @@ char* ap_cmd_name(ArgParser* parser);
|
||||
// Returns the command's parser instance, if the parser has found a command.
|
||||
ArgParser* ap_cmd_parser(ArgParser* parser);
|
||||
|
||||
// This booleanean switch toggles support for an automatic 'help' command that
|
||||
// This boolean switch toggles support for an automatic 'help' command that
|
||||
// prints subcommand helptext. The value defaults to false but gets toggled
|
||||
// automatically to true whenever a command is registered. You can use this
|
||||
// function to disable the feature if required.
|
||||
void ap_enable_help_command(ArgParser* parser, boolean enable);
|
||||
void ap_enable_help_command(ArgParser* parser, bool enable);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Debugging utilities.
|
||||
@@ -188,14 +188,14 @@ void ap_enable_help_command(ArgParser* parser, boolean enable);
|
||||
void ap_print(ArgParser* parser);
|
||||
|
||||
// True if an attempt to allocate memory failed.
|
||||
boolean ap_had_memory_error(ArgParser* parser);
|
||||
bool ap_had_memory_error(ArgParser* parser);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Deprecated.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Replaced by ap_enable_help_command().
|
||||
void ap_cmd_help(ArgParser* parser, boolean enable);
|
||||
void ap_cmd_help(ArgParser* parser, bool enable);
|
||||
|
||||
// Replaced by ap_set_helptext().
|
||||
void ap_helptext(ArgParser* parser, const char* helptext);
|
||||
|
||||
+11
-1
@@ -277,7 +277,7 @@ static xcommand_t *com_commands = NULL; // current commands
|
||||
|
||||
#define MAX_ARGS 80
|
||||
static size_t com_argc;
|
||||
static char *com_argv[MAX_ARGS];
|
||||
char *com_argv[MAX_ARGS];
|
||||
static const char *com_null_string = "";
|
||||
static char *com_args = NULL; // current command args or NULL
|
||||
|
||||
@@ -327,6 +327,16 @@ const char *COM_Argv(size_t arg)
|
||||
return com_argv[arg];
|
||||
}
|
||||
|
||||
/** Returns all of the console command arguments
|
||||
*
|
||||
* \return String pointer to the argv table.
|
||||
* \sa COM_ArgvList
|
||||
*/
|
||||
char **COM_ArgvList(void)
|
||||
{
|
||||
return com_argv;
|
||||
}
|
||||
|
||||
/** Gets all console command arguments.
|
||||
*
|
||||
* \return String pointer to all arguments for the last command.
|
||||
|
||||
@@ -33,8 +33,12 @@ typedef void (*com_func_t)(void);
|
||||
void COM_AddCommand(const char *name, com_func_t func);
|
||||
int COM_AddLuaCommand(const char *name);
|
||||
|
||||
#define MAX_ARGS 80
|
||||
extern char *com_argv[MAX_ARGS];
|
||||
|
||||
size_t COM_Argc(void);
|
||||
const char *COM_Argv(size_t arg); // if argv > argc, returns empty string
|
||||
char **COM_ArgvList(void);
|
||||
char *COM_Args(void);
|
||||
size_t COM_CheckParm(const char *check); // like M_CheckParm :)
|
||||
size_t COM_CheckPartialParm(const char *check);
|
||||
|
||||
+47
-79
@@ -143,11 +143,7 @@ static void Command_SetViews_f(void);
|
||||
static void Command_Addfilelocal(void);
|
||||
static void Command_Addfile(void);
|
||||
static void Command_Addskins(void);
|
||||
static void Command_Localskin1(void);
|
||||
static void Command_Localskin2(void);
|
||||
static void Command_Localskin3(void);
|
||||
static void Command_Localskin4(void);
|
||||
static void Command_LocalskinAll(void);
|
||||
static void Command_GLocalSkin(void);
|
||||
static void Command_ListWADS_f(void);
|
||||
#ifdef DELFILE
|
||||
static void Command_Delfile(void);
|
||||
@@ -657,11 +653,7 @@ void D_RegisterServerCommands(void)
|
||||
COM_AddCommand("addfilelocal", Command_Addfilelocal);
|
||||
COM_AddCommand("addfile", Command_Addfile);
|
||||
COM_AddCommand("addskins", Command_Addskins);
|
||||
COM_AddCommand("localskin", Command_Localskin1);
|
||||
COM_AddCommand("localskin2", Command_Localskin2);
|
||||
COM_AddCommand("localskin3", Command_Localskin3);
|
||||
COM_AddCommand("localskin4", Command_Localskin4);
|
||||
COM_AddCommand("localskinall", Command_LocalskinAll);
|
||||
COM_AddCommand("localskin", Command_GLocalSkin);
|
||||
COM_AddCommand("listwad", Command_ListWADS_f);
|
||||
|
||||
#ifdef DELFILE
|
||||
@@ -4681,80 +4673,56 @@ Command_Addskins (void)
|
||||
*/
|
||||
}
|
||||
|
||||
static void Command_Localskin1 (void) {
|
||||
if (!Playing() && !demo.playback)
|
||||
{
|
||||
CONS_Printf("You can only use this command in gameplay.\n");
|
||||
return;
|
||||
}
|
||||
if (COM_Argc() > 3)
|
||||
{
|
||||
CONS_Printf("localskin <name>: Set a localskin.\n");
|
||||
return;
|
||||
}
|
||||
if (fasticmp(COM_Argv(2), "-display") || fasticmp(COM_Argv(2), "-d"))
|
||||
SetLocalPlayerSkin(displayplayers[0], COM_Argv(1), &cv_localskin);
|
||||
else
|
||||
SetLocalPlayerSkin(consoleplayer, COM_Argv(1), &cv_localskin);
|
||||
}
|
||||
// args n stuff
|
||||
#include "args.h"
|
||||
|
||||
static void Command_Localskin2 (void) {
|
||||
if (!Playing() && !demo.playback)
|
||||
{
|
||||
CONS_Printf("You can only use this command in gameplay.\n");
|
||||
return;
|
||||
}
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
CONS_Printf("localskin2 <name>: Set a localskin.\n");
|
||||
return;
|
||||
}
|
||||
SetLocalPlayerSkin(displayplayers[1], COM_Argv(1), &cv_localskin2);
|
||||
}
|
||||
static void Command_GLocalSkin (void) {
|
||||
ArgParser* parser = ap_new();
|
||||
ap_set_helptext(parser, "Usage: localskin [options] <name>\n\nOptions: \n\
|
||||
-d, --display: Use the first displaying player instead of yourself.\n\
|
||||
Has no effect on replays. Omits any player related\n\
|
||||
options.\n\
|
||||
-a, --all: Set a localskin to all players. Omits any player related\n\
|
||||
options.\n\
|
||||
-p, --player: Set a localskin to a specific player name.\n\
|
||||
If omitted, defaults to the client player, unless -d \n\
|
||||
or --display is added.");
|
||||
ap_set_version(parser, "");
|
||||
ap_str_opt(parser, "player p", player_names[consoleplayer]);
|
||||
ap_flag(parser, "display d");
|
||||
ap_flag(parser, "all a");
|
||||
|
||||
static void Command_Localskin3 (void) {
|
||||
if (!Playing() && !demo.playback)
|
||||
{
|
||||
CONS_Printf("You can only use this command in gameplay.\n");
|
||||
return;
|
||||
}
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
CONS_Printf("localskin3 <name>: Set a localskin.\n");
|
||||
return;
|
||||
}
|
||||
SetLocalPlayerSkin(displayplayers[2], COM_Argv(1), &cv_localskin3);
|
||||
}
|
||||
ap_parse(parser, COM_Argc(), COM_ArgvList());
|
||||
|
||||
static void Command_Localskin4 (void) {
|
||||
if (!Playing() && !demo.playback)
|
||||
{
|
||||
CONS_Printf("You can only use this command in gameplay.\n");
|
||||
return;
|
||||
}
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
CONS_Printf("localskin4 <name>: Set a localskin.\n");
|
||||
return;
|
||||
}
|
||||
SetLocalPlayerSkin(displayplayers[3], COM_Argv(1), &cv_localskin4);
|
||||
}
|
||||
boolean disply;
|
||||
boolean allp;
|
||||
|
||||
static void Command_LocalskinAll (void) {
|
||||
if (!Playing() && !demo.playback)
|
||||
{
|
||||
CONS_Printf("You can only use this command in gameplay.\n");
|
||||
return;
|
||||
}
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
CONS_Printf("localskinall <name>: Set a localskin to all players.\n");
|
||||
return;
|
||||
}
|
||||
INT32 i;
|
||||
for (i; i < MAXPLAYERS; i++) {
|
||||
SetLocalPlayerSkin(i, COM_Argv(1), &cv_localskinall);
|
||||
if (ap_found(parser, "display")) disply = true; else disply = false;
|
||||
if (ap_found(parser, "all")) allp = true; else allp = false;
|
||||
|
||||
INT32 i, idx;
|
||||
i = 0;
|
||||
idx = 0;
|
||||
|
||||
for (idx = 0; idx < ap_count_args(parser); idx++) {
|
||||
if (disply) {
|
||||
SetLocalPlayerSkin(displayplayers[0], ap_arg(parser, idx), &cv_localskin);
|
||||
return;
|
||||
} else {
|
||||
for (i = 0; i < MAXPLAYERS; i++) {
|
||||
if (allp) {
|
||||
SetLocalPlayerSkin(i, ap_arg(parser, idx), &cv_localskinall);
|
||||
} else {
|
||||
if (fasticmp(player_names[i], ap_str_value(parser, "player"))) {
|
||||
SetLocalPlayerSkin(i, ap_arg(parser, idx), &cv_localskin);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ap_free(parser);
|
||||
}
|
||||
|
||||
#ifdef DELFILE
|
||||
|
||||
@@ -4173,6 +4173,12 @@ void A_SignPlayer(mobj_t *actor)
|
||||
// same thing happens on p_mobj.c
|
||||
ov->localskin = &localskins[actor->target->player->localskin - 1];
|
||||
ov->skinlocal = actor->target->skinlocal;
|
||||
} else {
|
||||
// needs - 1 or else it pukes an error out
|
||||
// same thing happens on p_mobj.c
|
||||
if (actor->target->player->localskin)
|
||||
ov->localskin = &skins[actor->target->player->localskin - 1];
|
||||
ov->skinlocal = actor->target->skinlocal;
|
||||
}
|
||||
P_SetMobjState(ov, actor->info->seestate); // S_PLAY_SIGN
|
||||
}
|
||||
|
||||
@@ -2880,7 +2880,9 @@ void R_InitSkins(void)
|
||||
strncpy(skin->facerank, "PLAYRANK", 9);
|
||||
strncpy(skin->facewant, "PLAYWANT", 9);
|
||||
strncpy(skin->facemmap, "PLAYMMAP", 9);
|
||||
skin->wadnum = 0; // god what have you brought to this world
|
||||
skin->prefcolor = SKINCOLOR_BLUE;
|
||||
skin->localskin = false;
|
||||
|
||||
// SRB2kart
|
||||
skin->kartspeed = 8;
|
||||
@@ -3030,10 +3032,12 @@ void SetLocalPlayerSkin(INT32 playernum, const char *skinname, consvar_t *cvar)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (player->localskin > 0)
|
||||
CV_StealthSet(cvar, ( (player->skinlocal) ? localskins : skins )[player->localskin - 1].name);
|
||||
else
|
||||
CV_StealthSet(cvar, "none");
|
||||
*/
|
||||
}
|
||||
|
||||
// Same as SetPlayerSkin, but uses the skin #.
|
||||
@@ -3489,6 +3493,8 @@ next_token:
|
||||
Forceskin_cons_t[numskins+1].value = numskins;
|
||||
Forceskin_cons_t[numskins+1].strvalue = skins[numskins].name;
|
||||
}
|
||||
|
||||
skin->localskin = local;
|
||||
|
||||
// add face graphics
|
||||
if (local) {
|
||||
|
||||
@@ -97,6 +97,8 @@ typedef struct
|
||||
|
||||
// specific sounds per skin
|
||||
sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
|
||||
|
||||
boolean localskin;
|
||||
} skin_t;
|
||||
|
||||
extern CV_PossibleValue_t Forceskin_cons_t[];
|
||||
|
||||
Reference in new issue
Block a user