Unbreak base/src.
This commit is contained in:
parent
d0838eab60
commit
3e8cf479c9
9 changed files with 211 additions and 2 deletions
|
@ -4,7 +4,6 @@
|
|||
|
||||
#define CSQC
|
||||
#define CLIENT
|
||||
#define NEW_INVENTORY
|
||||
|
||||
#includelist
|
||||
/* first the engine, then nuclide headers for client/shared */
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include "gamerules.h"
|
||||
#include "items.h"
|
||||
|
||||
// stubs for spawning
|
||||
void info_player_deathmatch(void)
|
||||
|
|
32
base/src/server/items.h
Normal file
32
base/src/server/items.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2022 Vera Visions LLC.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* PICKUP ITEMS */
|
||||
class item_pickup:NSRenderableEntity
|
||||
{
|
||||
int m_bFloating;
|
||||
int m_iClip;
|
||||
int m_iWasDropped;
|
||||
int id;
|
||||
void item_pickup(void);
|
||||
|
||||
virtual void Spawned(void);
|
||||
virtual void Touch(entity);
|
||||
virtual void SetItem(int i);
|
||||
virtual void Respawn(void);
|
||||
virtual void SetFloating(int);
|
||||
virtual void PickupRespawn(void);
|
||||
};
|
92
base/src/server/items.qc
Normal file
92
base/src/server/items.qc
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2022 Vera Visions LLC.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
void item_pickup::Touch(entity eToucher)
|
||||
{
|
||||
if (eToucher.classname != "player") {
|
||||
return;
|
||||
}
|
||||
|
||||
/* don't remove if AddItem fails */
|
||||
if (Weapons_AddItem((player)eToucher, id, m_iClip) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging_Pickup(eToucher, this, __NULL__);
|
||||
Sound_Play(other, CHAN_ITEM, "weapon.pickup");
|
||||
|
||||
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
|
||||
|
||||
if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) {
|
||||
Destroy();
|
||||
} else {
|
||||
Disappear();
|
||||
ScheduleThink(PickupRespawn, 30.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void item_pickup::SetItem(int i)
|
||||
{
|
||||
id = i;
|
||||
m_oldModel = Weapons_GetWorldmodel(id);
|
||||
SetModel(GetSpawnModel());
|
||||
SetSize([-16,-16,0], [16,16,16]);
|
||||
}
|
||||
|
||||
void item_pickup::SetFloating(int i)
|
||||
{
|
||||
m_bFloating = rint(bound(0, m_bFloating, 1));
|
||||
}
|
||||
|
||||
void
|
||||
item_pickup::PickupRespawn(void)
|
||||
{
|
||||
Respawn();
|
||||
Sound_Play(this, CHAN_ITEM, "item.respawn");
|
||||
}
|
||||
|
||||
void item_pickup::Respawn(void)
|
||||
{
|
||||
SetSolid(SOLID_TRIGGER);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
botinfo = BOTINFO_WEAPON;
|
||||
|
||||
/* At some points, the item id might not yet be set */
|
||||
if (GetSpawnModel()) {
|
||||
SetModel(GetSpawnModel());
|
||||
}
|
||||
|
||||
SetSize([-16,-16,0], [16,16,16]);
|
||||
ReleaseThink();
|
||||
|
||||
if (!m_bFloating) {
|
||||
DropToFloor();
|
||||
SetMovetype(MOVETYPE_TOSS);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
item_pickup::Spawned(void)
|
||||
{
|
||||
super::Spawned();
|
||||
|
||||
Sound_Precache("item.respawn");
|
||||
Sound_Precache("weapon.pickup");
|
||||
}
|
||||
|
||||
void item_pickup::item_pickup(void)
|
||||
{
|
||||
}
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#define QWSSQC
|
||||
#define SERVER
|
||||
#define NEW_INVENTORY
|
||||
|
||||
#includelist
|
||||
/* engine, then nuclide headers & functions */
|
||||
|
@ -27,6 +26,7 @@ gamerules.qc
|
|||
gamerules_singleplayer.qc
|
||||
gamerules_multiplayer.qc
|
||||
modelevent.qc
|
||||
items.qc
|
||||
|
||||
/* global server/shared code */
|
||||
../../../src/server/include.src
|
||||
|
|
40
base/src/shared/flags.h
Normal file
40
base/src/shared/flags.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2022 Vera Visions LLC.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* game flags */
|
||||
#define GF_SEMI_TOGGLED (int)(1<<0)
|
||||
#define GF_FLASHLIGHT (int)(1<<1)
|
||||
#define GF_UNUSED3 (int)(1<<2)
|
||||
#define GF_UNUSED4 (int)(1<<3)
|
||||
#define GF_UNUSED5 (int)(1<<4)
|
||||
#define GF_UNUSED6 (int)(1<<5)
|
||||
#define GF_UNUSED7 (int)(1<<6)
|
||||
#define GF_UNUSED8 (int)(1<<7)
|
||||
#define GF_UNUSED9 (int)(1<<8)
|
||||
#define GF_UNUSED10 (int)(1<<9)
|
||||
#define GF_UNUSED11 (int)(1<<10)
|
||||
#define GF_UNUSED12 (int)(1<<11)
|
||||
#define GF_UNUSED13 (int)(1<<12)
|
||||
#define GF_UNUSED14 (int)(1<<14)
|
||||
#define GF_UNUSED15 (int)(1<<16)
|
||||
#define GF_UNUSED16 (int)(1<<13)
|
||||
#define GF_UNUSED17 (int)(1<<17)
|
||||
#define GF_UNUSED18 (int)(1<<18)
|
||||
#define GF_UNUSED19 (int)(1<<19)
|
||||
#define GF_UNUSED20 (int)(1<<20)
|
||||
#define GF_UNUSED21 (int)(1<<21)
|
||||
#define GF_UNUSED22 (int)(1<<22)
|
||||
#define GF_UNUSED23 (int)(1<<23)
|
|
@ -1,5 +1,8 @@
|
|||
#includelist
|
||||
player.qc
|
||||
weapon_common.h
|
||||
weapons.h
|
||||
flags.h
|
||||
fx_explosion.qc
|
||||
fx_spark.qc
|
||||
fx_blood.qc
|
||||
|
@ -8,4 +11,6 @@ fx_corpse.qc
|
|||
fx_gibhuman.qc
|
||||
fx_impact.qc
|
||||
TestWeapon.qc
|
||||
weapons.qc
|
||||
weapon_common.qc
|
||||
#endlist
|
||||
|
|
20
base/src/shared/weapons.h
Normal file
20
base/src/shared/weapons.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Vera Visions LLC.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
WEAPON_NONE
|
||||
};
|
20
base/src/shared/weapons.qc
Normal file
20
base/src/shared/weapons.qc
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Vera Visions LLC.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
weapon_t w_null = {};
|
||||
weapon_t g_weapons[] = {
|
||||
w_null
|
||||
};
|
Loading…
Reference in a new issue