X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fminigames%2Fsv_minigames.qh;h=b5015a1f40fd3e452d83ce2d23ed5a510ce63c4c;hb=60b0e81cdaed847a7aac9d234f219937ab9462b2;hp=0fb3d572cc6996d2849bb9ccc17f69c94c58d4ba;hpb=6603ee5ff104719d3d4b9dad7ae4bf66f46706e5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/minigames/sv_minigames.qh b/qcsrc/common/minigames/sv_minigames.qh index 0fb3d572c..b5015a1f4 100644 --- a/qcsrc/common/minigames/sv_minigames.qh +++ b/qcsrc/common/minigames/sv_minigames.qh @@ -1,5 +1,4 @@ -#ifndef SV_MINIGAMES_H -#define SV_MINIGAMES_H +#pragma once /// Create a new minigame session /// \return minigame session entity @@ -24,13 +23,13 @@ void end_minigames(); // Only sends entities to players who joined the minigame // Use on customizeentityforclient for gameplay entities -bool minigame_CheckSend(); +bool minigame_CheckSend(entity this, entity client); // Check for minigame impulses -bool MinigameImpulse(int imp); +bool MinigameImpulse(entity this, int imp); // Parse a client command ( cmd minigame ... ) -void ClientCommand_minigame(int request, int argc, string command); +void ClientCommand_minigame(entity caller, int request, int argc, string command); // Find the minigame_player entity for the given client entity entity minigame_find_player(entity client); @@ -46,19 +45,16 @@ entity minigame_sessions; bool minigame_SendEntity(entity this, entity to, int sf); -REGISTRY(Minigames, BITS(3)) +REGISTRY(Minigames, BITS(4)) #define Minigames_from(i) _Minigames_from(i, NULL) REGISTER_REGISTRY(Minigames) REGISTRY_CHECK(Minigames) #define REGISTER_MINIGAME(name,nicename) \ - REGISTER(Minigames, MINIGAME_##name, m_id, new(minigame_descriptor)); \ + REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \ int name##_server_event(entity, string, ...); \ - REGISTER_INIT_POST(MINIGAME_##name) { \ - make_pure(this); \ + REGISTER_INIT(MINIGAME_##name) { \ this.netname = strzone(strtolower(#name)); \ this.message = nicename; \ this.minigame_event = name##_server_event; \ } \ REGISTER_INIT(MINIGAME_##name) - -#endif