Skip to content

Commit fb0db9a

Browse files
committed
Fixed CS:GO compiler error
1 parent 9d868bd commit fb0db9a

File tree

4 files changed

+78
-1
lines changed

4 files changed

+78
-1
lines changed

Diff for: src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ Set(SOURCEPYTHON_CONVERSIONS_MODULE_SOURCES
166166
# Cvars module.
167167
# ------------------------------------------------------------------
168168
Set(SOURCEPYTHON_CVARS_MODULE_HEADERS
169+
core/modules/cvars/${SOURCE_ENGINE}/cvars_wrap.h
169170
)
170171

171172
Set(SOURCEPYTHON_CVARS_MODULE_SOURCES

Diff for: src/core/modules/cvars/csgo/cvars_wrap.h

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2014 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#include "icvar.h"
28+
29+
class ICVarExt
30+
{
31+
public:
32+
static ConCommandBase* GetCommands(ICvar* pCvar)
33+
{
34+
ICvar::Iterator iter(pCvar);
35+
iter.SetFirst();
36+
return iter.Get();
37+
};
38+
};

Diff for: src/core/modules/cvars/cvars_wrap_python.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include "modules/export_main.h"
3333
#include "modules/memory/memory_tools.h"
3434

35+
#include ENGINE_INCLUDE_PATH(cvars_wrap.h)
36+
3537

3638
//-----------------------------------------------------------------------------
3739
// External variables
@@ -92,7 +94,7 @@ void export_cvar_interface()
9294
)
9395

9496
.def("get_commands",
95-
GET_METHOD(ConCommandBase *, ICvar, GetCommands),
97+
ICVarExt::GetCommands,
9698
"Get first ConCommandBase to allow iteration.",
9799
reference_existing_object_policy()
98100
)

Diff for: src/core/modules/cvars/orangebox/cvars_wrap.h

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2014 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#include "icvar.h"
28+
29+
class ICVarExt
30+
{
31+
public:
32+
static ConCommandBase* GetCommands(ICvar* pCvar)
33+
{
34+
return pCvar->GetCommands();
35+
};
36+
};

0 commit comments

Comments
 (0)