mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Fixes paper limit bugs
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam
|
||||
#define MAX_MESSAGE_LEN 1024
|
||||
#define MAX_PAPER_MESSAGE_LEN 3072
|
||||
#define MAX_PAPER_FIELDS 50
|
||||
#define MAX_BOOK_MESSAGE_LEN 9216
|
||||
#define MAX_NAME_LEN 26
|
||||
|
||||
|
||||
@@ -140,10 +140,13 @@
|
||||
..()
|
||||
|
||||
/obj/item/weapon/paper/proc/addtofield(var/id, var/text, var/links = 0)
|
||||
if(id > MAX_PAPER_FIELDS)
|
||||
return
|
||||
|
||||
var/locid = 0
|
||||
var/laststart = 1
|
||||
var/textindex = 1
|
||||
while(1) // I know this can cause infinite loops and fuck up the whole server, but the if(istart==0) should be safe as fuck
|
||||
while(locid <= MAX_PAPER_FIELDS)
|
||||
var/istart = 0
|
||||
if(links)
|
||||
istart = findtext(info_links, "<span class=\"paper_field\">", laststart)
|
||||
@@ -248,11 +251,11 @@
|
||||
|
||||
t = "<font face=\"[crayonfont]\" color=[P ? P.colour : "black"]><b>[t]</b></font>"
|
||||
|
||||
// t = replacetext(t, "#", "") // Junk converted to nothing!
|
||||
t = copytext(t, 1, MAX_PAPER_MESSAGE_LEN)
|
||||
|
||||
//Count the fields
|
||||
var/laststart = 1
|
||||
while(1)
|
||||
while(fields < MAX_PAPER_FIELDS)
|
||||
var/i = findtext(t, "<span class=\"paper_field\">", laststart)
|
||||
if(i==0)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user