Skip to content

Commit

Permalink
addthinktoent update
Browse files Browse the repository at this point in the history
  • Loading branch information
Brain-dawg committed Dec 8, 2024
1 parent 27c9eb1 commit 00c3323
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/vscripts/popextensions_main.nut
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
::popExtensionsVersion <- "11.27.2024.1"
::popExtensionsVersion <- "12.2.2024.1"
local _root = getroottable()

local o = Entities.FindByClassname(null, "tf_objective_resource")
Expand Down Expand Up @@ -42,8 +42,13 @@ if (!("_AddThinkToEnt" in _root))
foreach (k, v in banned_think_classnames)
if (startswith(ent.GetClassname(), k))
{
error(format("ERROR: AddThinkToEnt on '%s' entities is forbidden! Use PopExtUtil.AddThinkToEnt instead\n", k))
ClientPrint(null, HUD_PRINTTALK, format("\x08FFB4B4FF**WARNING: AddThinkToEnt on '%s' entities is forbidden!**\n\n Use PopExtUtil.AddThinkToEnt instead.\n\nExample: AddThinkToEnt(ent, \"%s\") -> PopExtUtil.AddThinkToEnt(ent, \"%s\")", k, func, func))
error(format("ERROR: **POPEXTENSIONS WARNING: AddThinkToEnt on '%s' entity overwritten!**\n", k))
// ClientPrint(null, HUD_PRINTTALK, format("\x08FFB4B4FF**WARNING: AddThinkToEnt on '%s' entities is forbidden!**\n\n Use PopExtUtil.AddThinkToEnt instead.\n\nExample: AddThinkToEnt(ent, \"%s\") -> PopExtUtil.AddThinkToEnt(ent, \"%s\")", k, func, func))

local entstring = ""+ent
//we use printl instead of printf because it's redirected to player console on potato servers
printl(format("\n\n**POPEXTENSIONS WARNING: AddThinkToEnt on '%s' overwritten!**\n\nAddThinkToEnt(ent, \"%s\") -> PopExtUtil.AddThinkToEnt(ent, \"%s\")\n\n", entstring, func, func))
PopExtUtil.AddThinkToEnt(ent, func)
return
}

Expand Down

0 comments on commit 00c3323

Please sign in to comment.