Share fng and vanilla tiles with the server

While implementing a ddnet based fng mod I realized that I reimplemented
the same enum that already exists on the client side.

So this encourages fng mod developers to use the indecies that the ddnet
client already knows.
This commit is contained in:
ChillerDragon 2024-09-10 09:36:37 +08:00
parent b5d662622c
commit 2a71c7fce2
5 changed files with 57 additions and 44 deletions

View file

@ -2162,6 +2162,8 @@ set_src(GAME_SHARED GLOB src/game
mapitems_ex.cpp mapitems_ex.cpp
mapitems_ex.h mapitems_ex.h
mapitems_ex_types.h mapitems_ex_types.h
mapitems_fng.h
mapitems_vanilla.h
prng.cpp prng.cpp
prng.h prng.h
teamscore.cpp teamscore.cpp

View file

@ -1044,50 +1044,6 @@ public:
TILE_PUB_ENTITIES_OFF2, TILE_PUB_ENTITIES_OFF2,
}; };
enum
{
TILE_FNG_SPIKE_GOLD = 7,
TILE_FNG_SPIKE_NORMAL,
TILE_FNG_SPIKE_RED,
TILE_FNG_SPIKE_BLUE,
TILE_FNG_SCORE_RED,
TILE_FNG_SCORE_BLUE,
TILE_FNG_SPIKE_GREEN = 14,
TILE_FNG_SPIKE_PURPLE,
TILE_FNG_SPAWN = 192,
TILE_FNG_SPAWN_RED,
TILE_FNG_SPAWN_BLUE,
TILE_FNG_FLAG_RED,
TILE_FNG_FLAG_BLUE,
TILE_FNG_SHIELD,
TILE_FNG_HEART,
TILE_FNG_SHOTGUN,
TILE_FNG_GRENADE,
TILE_FNG_NINJA,
TILE_FNG_LASER,
TILE_FNG_SPIKE_OLD1 = 208,
TILE_FNG_SPIKE_OLD2,
TILE_FNG_SPIKE_OLD3
};
enum
{
TILE_VANILLA_SPAWN = 192,
TILE_VANILLA_SPAWN_RED,
TILE_VANILLA_SPAWN_BLUE,
TILE_VANILLA_FLAG_RED,
TILE_VANILLA_FLAG_BLUE,
TILE_VANILLA_SHIELD,
TILE_VANILLA_HEART,
TILE_VANILLA_SHOTGUN,
TILE_VANILLA_GRENADE,
TILE_VANILLA_NINJA,
TILE_VANILLA_LASER,
};
// Explanations // Explanations
enum class EExplanation enum class EExplanation
{ {

View file

@ -1,3 +1,6 @@
#include <game/mapitems_fng.h>
#include <game/mapitems_vanilla.h>
#include "editor.h" #include "editor.h"
// DDNet entity explanations by Lady Saavik // DDNet entity explanations by Lady Saavik

33
src/game/mapitems_fng.h Normal file
View file

@ -0,0 +1,33 @@
#ifndef GAME_MAPITEMS_FNG_H
#define GAME_MAPITEMS_FNG_H
enum
{
TILE_FNG_SPIKE_GOLD = 7,
TILE_FNG_SPIKE_NORMAL,
TILE_FNG_SPIKE_RED,
TILE_FNG_SPIKE_BLUE,
TILE_FNG_SCORE_RED,
TILE_FNG_SCORE_BLUE,
TILE_FNG_SPIKE_GREEN = 14,
TILE_FNG_SPIKE_PURPLE,
TILE_FNG_SPAWN = 192,
TILE_FNG_SPAWN_RED,
TILE_FNG_SPAWN_BLUE,
TILE_FNG_FLAG_RED,
TILE_FNG_FLAG_BLUE,
TILE_FNG_SHIELD,
TILE_FNG_HEART,
TILE_FNG_SHOTGUN,
TILE_FNG_GRENADE,
TILE_FNG_NINJA,
TILE_FNG_LASER,
TILE_FNG_SPIKE_OLD1 = 208,
TILE_FNG_SPIKE_OLD2,
TILE_FNG_SPIKE_OLD3
};
#endif

View file

@ -0,0 +1,19 @@
#ifndef GAME_MAPITEMS_VANILLA_H
#define GAME_MAPITEMS_VANILLA_H
enum
{
TILE_VANILLA_SPAWN = 192,
TILE_VANILLA_SPAWN_RED,
TILE_VANILLA_SPAWN_BLUE,
TILE_VANILLA_FLAG_RED,
TILE_VANILLA_FLAG_BLUE,
TILE_VANILLA_SHIELD,
TILE_VANILLA_HEART,
TILE_VANILLA_SHOTGUN,
TILE_VANILLA_GRENADE,
TILE_VANILLA_NINJA,
TILE_VANILLA_LASER,
};
#endif