- 0
Sign in to follow this
Followers
0
Some errors at compile my rAthena patch here in Hercules
Asked by
Yum
-
Recently Browsing 0 members
No registered users viewing this page.

Error clif.c
Line 9930:
invocation = str_replace(god_db[sd->status.god].invocation,"{CHARNAME}",sd->status.name);My Patch:
strlib.c
+char *str_replace( const char *string, const char *substr, const char *replacement )+{+ char *tok = NULL;+ char *newstr = NULL;+ + tok = strstr( string, substr );+ if( tok == NULL ) return strdup( string );+ newstr = malloc( strlen( string ) - strlen( substr ) + strlen( replacement ) + 1 );+ if( newstr == NULL ) return NULL;+ memcpy( newstr, string, tok - string );+ memcpy( newstr + (tok - string), replacement, strlen( replacement ) );+ memcpy( newstr + (tok - string) + strlen( replacement ), tok + strlen( substr ), strlen( string ) - strlen( substr ) - ( tok - string ) );+ memset( newstr + strlen( string ) - strlen( substr ) + strlen( replacement ), 0, 1 );+ return newstr;+}strlib.h
clif.c
+ if(sd->status.god != 0 && god_db[sd->status.god].god_id && sd->status.base_level >= MAX_LEVEL) {+ invocation = (char *)aMalloc(sizeof(char *));+ //ShowDebug("Tamanho do buffer criado: %d",sizeof(invocation));+ invocation = str_replace(god_db[sd->status.god].invocation,"{CHARNAME}",sd->status.name);+ //ShowDebug("Tamanho do buffer final: %d",sizeof(invocation));+ if(strcmp(invocation,message) == 0) {+ sc_start(&sd->bl,god_db[sd->status.god].buffid[0],100,god_db[sd->status.god].bufflv[0],god_db[sd->status.god].bufftm[0]);+ sc_start(&sd->bl,god_db[sd->status.god].buffid[1],100,god_db[sd->status.god].bufflv[1],god_db[sd->status.god].bufftm[1]);+ }+ }Error pc.c
Line 5717
Edited by YumShare this post
Link to post
Share on other sites