Added check to make sure player are alive to perform sm_slap, sm_burn, sm_slay.
3 * ================================================================
4 * SourceMod SDKTools Extension
5 * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
6 * ================================================================
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License,
10 * version 3.0, as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to
21 * link the code of this program (as well as its derivative works) to
22 * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
23 * Game MODs that run on software by the Valve Corporation. You must
24 * obey the GNU General Public License in all respects for all other
25 * code used. Additionally, AlliedModders LLC grants this exception
26 * to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version
28 * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
33 #ifndef _INCLUDE_SOURCEMOD_CELLRECIPIENTFILTER_H_
34 #define _INCLUDE_SOURCEMOD_CELLRECIPIENTFILTER_H_
36 #include <irecipientfilter.h>
37 #include <sp_vm_types.h>
39 class CellRecipientFilter : public IRecipientFilter
42 CellRecipientFilter() : m_IsReliable(false), m_IsInitMessage(false), m_Size(0) {}
43 ~CellRecipientFilter() {}
44 public: //IRecipientFilter
45 bool IsReliable() const;
46 bool IsInitMessage() const;
47 int GetRecipientCount() const;
48 int GetRecipientIndex(int slot) const;
50 void Initialize(cell_t *ptr, size_t count);
51 void SetToReliable(bool isreliable);
52 void SetToInit(bool isinitmsg);
55 cell_t m_Players[255];
61 inline void CellRecipientFilter::Reset()
64 m_IsInitMessage = false;
68 inline bool CellRecipientFilter::IsReliable() const
73 inline bool CellRecipientFilter::IsInitMessage() const
75 return m_IsInitMessage;
78 inline int CellRecipientFilter::GetRecipientCount() const
83 inline int CellRecipientFilter::GetRecipientIndex(int slot) const
85 if ((slot < 0) || (slot >= GetRecipientCount()))
89 return static_cast<int>(m_Players[slot]);
92 inline void CellRecipientFilter::SetToInit(bool isinitmsg)
94 m_IsInitMessage = isinitmsg;
97 inline void CellRecipientFilter::SetToReliable(bool isreliable)
99 m_IsReliable = isreliable;
102 inline void CellRecipientFilter::Initialize(cell_t *ptr, size_t count)
104 memcpy(m_Players, ptr, count * sizeof(cell_t));
108 #endif //_INCLUDE_SOURCEMOD_CELLRECIPIENTFILTER_H_