summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-07 16:29:08 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-07 16:29:08 +0000
commitc2dc29da562cb98000c809f53d9baa0e6a2eeb71 (patch)
tree23473ebf6d75f11432c29f5c71ae538afa82e77d
parent1b73b82ea629ff1e69fc2d6094c27e9e32229a84 (diff)
downloadhercules-c2dc29da562cb98000c809f53d9baa0e6a2eeb71.tar.gz
hercules-c2dc29da562cb98000c809f53d9baa0e6a2eeb71.tar.bz2
hercules-c2dc29da562cb98000c809f53d9baa0e6a2eeb71.tar.xz
hercules-c2dc29da562cb98000c809f53d9baa0e6a2eeb71.zip
- Added a check to prevent casting ground skills on a target and vice-versa when said skill use packets are received. It really shouldn't be exploitable, but doing that certainly makes the server print a lot of "unknown skill used!" messages.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9163 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--src/map/clif.c19
2 files changed, 16 insertions, 7 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index b66e778b6..bb70c1719 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,10 @@ 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/11/07
+ * Added a check to prevent casting ground skills on a target and vice-versa
+ when said skill use packets are received. It really shouldn't be
+ exploitable, but doing that certainly makes the server print a lot of
+ "unknown skill used!" messages. [Skotlex]
* Fixed map_foreachiddb and map_foreachpc so they don't encapsulate the
variable arguments into a double va_arg list. Thanks to the Ultra Mage for
the tip. [Skotlex]
diff --git a/src/map/clif.c b/src/map/clif.c
index 710d7a06e..fdb7537ca 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9724,7 +9724,7 @@ static void clif_parse_UseSkillToId_homun(struct homun_data *hd, struct map_sess
*------------------------------------------
*/
void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) {
- int skillnum, skilllv, lv, target_id;
+ int skillnum, skilllv, tmp, target_id;
unsigned int tick = gettick();
RFIFOHEAD(fd);
@@ -9741,6 +9741,10 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) {
//Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
sd->idletime = last_tick;
+ tmp = skill_get_inf(skillnum);
+ if (tmp&INF_GROUND_SKILL)
+ return; //Using a ground skill on a target? WRONG.
+
if (skillnum >= HM_SKILLBASE && skillnum <= HM_SKILLBASE+MAX_HOMUNSKILL) {
clif_parse_UseSkillToId_homun(sd->hd, sd, tick, skillnum, skilllv, target_id);
return;
@@ -9749,9 +9753,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) {
if (skillnotok(skillnum, sd))
return;
- if (sd->bl.id != target_id &&
- !sd->state.skill_flag &&
- skill_get_inf(skillnum)&INF_SELF_SKILL)
+ if (sd->bl.id != target_id && !sd->state.skill_flag && tmp&INF_SELF_SKILL)
target_id = sd->bl.id; //What good is it to mess up the target in self skills? Wished I knew... [Skotlex]
if (sd->ud.skilltimer != -1) {
@@ -9814,9 +9816,9 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) {
else
skilllv = 0;
} else {
- lv = pc_checkskill(sd, skillnum);
- if (skilllv > lv)
- skilllv = lv;
+ tmp = pc_checkskill(sd, skillnum);
+ if (skilllv > tmp)
+ skilllv = tmp;
}
if (skilllv)
@@ -9842,6 +9844,9 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll
if (skillnotok(skillnum, sd))
return;
+ if (!(skill_get_inf(skillnum)&INF_GROUND_SKILL))
+ return; //Using a target skill on the ground? WRONG.
+
if (skillmoreinfo != -1) {
if (pc_issit(sd)) {
clif_skill_fail(sd, skillnum, 0, 0);