Bläddra i källkod

* Fixed map_waterheight prefixing extra "data\"

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5966 54d463be-8e91-2dee-dedb-b68131a5f0ec
Lance 19 år sedan
förälder
incheckning
d955a685c3
2 ändrade filer med 7 tillägg och 2 borttagningar
  1. 1 0
      Changelog-Trunk.txt
  2. 6 2
      src/map/map.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/04/09
+	* Fixed map_waterheight prefixing extra "data\" [Lance]
 	* Mob_ai update. The attacked checks will trigger even if the mob can't
 	  move. Being attacked while the mob can't move no longer will trigger
 	  rude-attacked skills. [Skotlex]

+ 6 - 2
src/map/map.c

@@ -2351,7 +2351,7 @@ int map_setwaterheight(int m, char *mapname, int height) {
  */
 int map_waterheight(char *mapname) {
 	char fn[256];
- 	char *rsw;
+ 	char *rsw, *found;
 	float whtemp;
 	int wh;
 
@@ -2365,7 +2365,11 @@ int map_waterheight(char *mapname) {
 	//Look up for the rsw
 	sprintf(fn,"data\\%s",mapname);
 
-	sprintf(fn,"data\\%s",grfio_find_file(fn));
+	found = grfio_find_file(fn);
+	if(!strstr(found,"data\\"))
+		sprintf(fn,"data\\%s", found);
+	else
+		strcpy(fn, found);
 	
 	rsw = strstr(fn, ".");
 	if (rsw && strstr(fn, ".rsw") == NULL)