Skip to content

Commit 825987b

Browse files
committed
Fixed some small bits that I forgot to update.
1 parent 97b8888 commit 825987b

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
> This plugin was designed in mind for SourceMods, meaning mods loaded through the `sourcemods` folder in Steam. Not for Portal 2 mods that are on Steam.
1010
>
1111
> While this plugin should be ok for a Steam Portal 2 mod, note that:
12+
>
1213
> 1. I do not know if Valve will allow such modifications on the Steam platform, especially if it involves one of their games.
1314
> 2. Compatibility will not be 100%, so expect bugs or other issues.
14-
> 3. If you are using this plugin with your mod, I am not responsible if anything bad happens to your mod's place on Steam.
15+
> 3. If you are using this plugin with your mod, I am not responsible if anything bad happens to your mod's page on Steam.
1516
>
1617
> I will, in the future, try to add custom elements involving interactions with Steam's API, like achievements, but for now, I don't expect this to work correctly with Steam mods. Plus, in the end, P2:CE will do this properly in the future.
1718
@@ -24,7 +25,8 @@
2425
* **(NOT IMPLEMENTED)** Custom Discord RPC for Portal 2 Source Mods.
2526
* **(NOT IMPLEMENTED)** Additional achievement support and features. Like custom achievements that span multiple maps and have more parts than Door Prize and Smash TV.
2627
* **(NOT IMPLEMENTED)** Use of player flashlight without needing cheats enabled.
27-
* **(NOT IMPLEMENTED)** As informed by MarvinG, `env_sun` disappears when over player crosshair. I have not confirmed this, and have never noticed it in general.
28+
* **(NOT IMPLEMENTED)** As informed by MarvinG, `env_sun` disappears when over player crosshair. I have not confirmed this myself, and have never noticed it in general.
29+
* **(NOT IMPLEMENTED)** When in water, the player is pushed to the world's origin.
2830

2931
### Download and Install Instructions:
3032

globals.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ void Log(const LogLevel level, const bool dev, const char* pMsgFormat, ...)
4949

5050
switch (level)
5151
{
52-
case 0:
52+
case (INFO):
5353
ConColorMsg(P2SMPLUSPLUS_PLUGIN_CONSOLE_COLOR, completeMsg);
5454
return;
55-
case 1:
55+
case (WARNING):
5656
Warning(completeMsg);
5757
return;
58-
case 2:
58+
case (ERRORR):
5959
Warning("(P2SourceMod++ PLUGIN):\n!!!ERROR ERROR ERROR!!!:\nA FATAL ERROR OCCURED WITH THE ENGINE:\n%s", completeMsg);
6060
Error(completeMsg);
6161
return;
6262
default:
63-
Warning("(P2SourceMod++ PLUGIN): Log level set outside of 0-1, \"%i\". Defaulting to level 0.\n", level);
63+
Warning("(P2SourceMod++ PLUGIN): Log level set outside of INFO-ERRORR, \"%i\". Defaulting to level INFO.\n", level);
6464
ConColorMsg(P2SMPLUSPLUS_PLUGIN_CONSOLE_COLOR, completeMsg);
6565
}
6666
}
@@ -193,7 +193,7 @@ bool IsBot(const int playerIndex)
193193
player_info_t playerInfo;
194194
if (!engineServer->GetPlayerInfo(playerIndex, &playerInfo))
195195
{
196-
Log(INFO, true, R"(Couldn't retrieve player info of player index "%i" in IsBot!)", playerIndex);
196+
Log(WARNING, true, R"(Couldn't retrieve player info of player index "%i" in IsBot!)", playerIndex);
197197
return false;
198198
}
199199

globals.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class CPlayerFilter : public IRecipientFilter
117117

118118
int GetRecipientCount() const override { return recipientCount; }
119119

120-
int GetRecipientIndex(int slot) const override
120+
int GetRecipientIndex(const int slot) const override
121121
{
122122
return (slot < 0 || slot >= recipientCount) ? -1 : recipients[slot];
123123
}
@@ -172,7 +172,7 @@ inline int ENTINDEX(CBaseEntity* pEnt)
172172
//---------------------------------------------------------------------------------
173173
// Purpose: Entity index to entity edict. Taken from utils.h.
174174
//---------------------------------------------------------------------------------
175-
inline edict_t* INDEXENT(int iEdictNum)
175+
inline edict_t* INDEXENT(const int iEdictNum)
176176
{
177177
Assert(iEdictNum >= 0 && iEdictNum < MAX_EDICTS);
178178
if (g_pGlobals->pEdicts)

sdk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ CBasePlayer* UTIL_PlayerByIndex(const int playerIndex)
5454
//---------------------------------------------------------------------------------
5555
// Purpose: Show on screen message to players. msg_dest are definSed macros in globals.hpp.
5656
//---------------------------------------------------------------------------------
57-
void UTIL_ClientPrint(CBasePlayer* player, int msg_dest, const char* msg_name, const char* param1, const char* param2, const char* param3, const char* param4)
57+
void UTIL_ClientPrint(CBasePlayer* player, const int msg_dest, const char* msg_name, const char* param1, const char* param2, const char* param3, const char* param4)
5858
{
5959
static auto ClientPrint_ = reinterpret_cast<void (__cdecl*)(CBasePlayer*, int, const char*, const char*, const char*, const char*, const char*)>(Memory::Scanner::Scan<void*>(SERVERDLL, "55 8B EC 83 EC 20 56 8B 75 08 85 F6 74 4C"));
6060
ClientPrint_(player, msg_dest, msg_name, param1, param2, param3, param4);

0 commit comments

Comments
 (0)