summaryrefslogtreecommitdiff
path: root/src/map/utils/formatutils.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-04 22:37:51 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-04 22:37:51 +0300
commit58b8c8d8cb9f78537495f908887fea9d0a451637 (patch)
tree74438cc91f5c5a6a7a953c98aa52106eb88b250f /src/map/utils/formatutils.c
parent857c86d93ebd68e5edbbe14ce26a16a967622822 (diff)
downloadevol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.tar.gz
evol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.tar.bz2
evol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.tar.xz
evol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.zip
Rename login/char/map dirs to elogin/echar/emap for avoid conflicts with hercules.
Diffstat (limited to 'src/map/utils/formatutils.c')
-rw-r--r--src/map/utils/formatutils.c116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/map/utils/formatutils.c b/src/map/utils/formatutils.c
deleted file mode 100644
index 6777423..0000000
--- a/src/map/utils/formatutils.c
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
-// Copyright (c) 2014 Evol developers
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "../../../../common/HPMi.h"
-#include "../../../../common/malloc.h"
-#include "../../../../common/mmo.h"
-#include "../../../../common/socket.h"
-#include "../../../../common/strlib.h"
-#include "../../../../map/script.h"
-
-#include "../../../../map/chrif.h"
-#include "../../../../map/clif.h"
-#include "../../../../map/npc.h"
-#include "../../../../map/pc.h"
-#include "../../../../map/script.h"
-#include "../../../../map/quest.h"
-
-#include "map/utils/formatutils.h"
-#include "map/lang.h"
-
-int format_sub(struct script_state* st, int translate)
-{
- TBL_PC *sd = NULL;
- if (translate)
- sd = script->rid2sd(st);
-
- if (!script_hasdata(st, 3))
- {
- if (sd)
- {
- if (translate == 2)
- {
- char *buf = aCalloc (strlen(script_getstr(st, 2)) + 3, sizeof(char));
- strcpy (buf, script_getstr(st, 2));
- if (sd->status.sex)
- strcat (buf, "#1");
- else
- strcat (buf, "#0");
- script_pushstr(st, aStrdup(lang_pctrans(buf, sd)));
- aFree (buf);
- }
- else
- {
- script_pushstr(st, aStrdup(lang_pctrans(script_getstr(st, 2), sd)));
- }
- }
- else
- {
- script_pushstr(st, aStrdup(script_getstr(st, 2)));
- }
- return 1;
- }
-
- char *line = (char *) aCalloc (550, sizeof (char));
- int idx = 3;
- if (sd)
- {
- if (translate == 2)
- {
- const char *str = NULL;
- char *buf = NULL;
- if (sd->status.sex)
- {
- str = script_getstr(st, 3);
- buf = aCalloc (strlen(str) + 3, sizeof(char));
- strcpy (buf, str);
- strcat (buf, "#1");
- }
- else
- {
- str = script_getstr(st, 2);
- buf = aCalloc (strlen(str) + 3, sizeof(char));
- strcpy (buf, str);
- strcat (buf, "#0");
- }
- strcpy(line, lang_pctrans(buf, sd));
- aFree (buf);
- idx = 4;
- }
- else
- {
- strcpy(line, lang_pctrans(script_getstr(st, 2), sd));
- }
- }
- else
- {
- strcpy(line, script_getstr(st, 2));
- }
-
- char *ptr = line;
- int sz = strlen(line);
- while (script_hasdata(st, idx))
- {
- char *tmp = strstr(ptr, "@@");
- if (!tmp)
- break;
- const char *item = script_getstr(st, idx);
- int len = strlen(item);
- if (len > 50)
- break;
- sz += len - 2;
- if (sz > 490)
- break;
- memmove(tmp + len, tmp + 2, strlen(tmp + 2));
- memcpy(tmp, item, len);
- ptr = tmp + len;
- idx ++;
- }
-
- script_pushstr(st, line);
- return 0;
-}