summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-27 00:31:29 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-27 00:31:29 +0000
commit760a86e1c577f776986f4558726a1784317037bb (patch)
tree1bd9ced75fd02c6a1cc74868c4e7bf9aa761ce11 /src/map/pet.c
parent19c0056b1af3fcc80e3f402e92ca605d4228873e (diff)
downloadhercules-760a86e1c577f776986f4558726a1784317037bb.tar.gz
hercules-760a86e1c577f776986f4558726a1784317037bb.tar.bz2
hercules-760a86e1c577f776986f4558726a1784317037bb.tar.xz
hercules-760a86e1c577f776986f4558726a1784317037bb.zip
- Moved the pet rename code from int_pet.c to inter.c and normalized it so it can be used for any object.
- Made homunculus renaming go through the char-server so it can be validated against the allowed characters setting. - Added battle config hom_rename so you can enable renaming multiple times your homunc. - Updated the hardcoded defaults for gvg-damage to what they should be. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9720 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index cf62696a6..fd65f9565 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -26,6 +26,7 @@
#include "script.h"
#include "skill.h"
#include "unit.h"
+#include "atcommand.h"
#define MIN_PETTHINKTIME 100
@@ -683,7 +684,7 @@ int pet_menu(struct map_session_data *sd,int menunum)
return 0;
}
-int pet_change_name(struct map_session_data *sd,char *name, int flag) //flag 0 = check name, 1 = good name
+int pet_change_name(struct map_session_data *sd,char *name)
{
int i;
struct pet_data *pd;
@@ -698,19 +699,24 @@ int pet_change_name(struct map_session_data *sd,char *name, int flag) //flag 0 =
return 1;
}
- if (!flag)
- return intif_rename_pet(sd, name);
-
- pet_stop_walking(pd,1);
-
- memcpy(pd->pet.name, name, NAME_LENGTH-1);
+ return intif_rename_pet(sd, name);
+}
+int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
+{
+ struct pet_data *pd = sd->pd;
+ if (!pd) return 0;
+ if (!flag) {
+ clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name for your pet.
+ clif_send_petstatus(sd); //Send status so client knows oet name change got rejected.
+ return 0;
+ }
+ memcpy(pd->pet.name, name, NAME_LENGTH-1);
clif_charnameack (0,&pd->bl);
pd->pet.rename_flag = 1;
clif_pet_equip(pd);
clif_send_petstatus(sd);
-
- return 0;
+ return 1;
}
int pet_equipitem(struct map_session_data *sd,int index)