diff --git a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua index ba3bd165c0..216af71e8a 100644 --- a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua +++ b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua @@ -174,6 +174,7 @@ end -------------------------------------------------------- e2function egpobject wirelink:egpText( number index, string text, vector2 pos ) if (!EGP:IsAllowed( self, this )) then return NULL_EGPOBJECT end + if #text>256 then text = string.sub(text, 1, 256) end local bool, obj = egp_create("Text", { index = index, text = text, x = pos[1], y = pos[2] }, this) if (bool) then EGP:DoAction( this, self, "SendObject", obj ) Update(self,this) end return obj @@ -181,6 +182,7 @@ end e2function egpobject wirelink:egpTextLayout( number index, string text, vector2 pos, vector2 size ) if (!EGP:IsAllowed( self, this )) then return NULL_EGPOBJECT end + if #text>256 then text = string.sub(text, 1, 256) end local bool, obj = egp_create("TextLayout", { index = index, text = text, x = pos[1], y = pos[2], w = size[1], h = size[2] }, this) if (bool) then EGP:DoAction( this, self, "SendObject", obj ) Update(self,this) end return obj @@ -193,6 +195,7 @@ __e2setcost(10) ---------------------------- e2function void wirelink:egpSetText( number index, string text ) if (!EGP:IsAllowed( self, this )) then return end + if #text>256 then text = string.sub(text, 1, 256) end local bool, k, v = hasObject(this, index) if (bool) then if v:EditObject({ text = text }) then EGP:DoAction( this, self, "SendObject", v ) Update(self,this) end