summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-23 03:28:54 +0000
committermomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-23 03:28:54 +0000
commitfa0e7ac66029cda08041f6ed9410bbafbe7a58b7 (patch)
tree0619f522069213662959253e02d4aba7d0613091 /src
parentbd4e344a476439af984995540cb3d037752981c8 (diff)
downloadhercules-fa0e7ac66029cda08041f6ed9410bbafbe7a58b7.tar.gz
hercules-fa0e7ac66029cda08041f6ed9410bbafbe7a58b7.tar.bz2
hercules-fa0e7ac66029cda08041f6ed9410bbafbe7a58b7.tar.xz
hercules-fa0e7ac66029cda08041f6ed9410bbafbe7a58b7.zip
- Temporary fix for bugreport:1023, where various 'next' buttons would pop --for now let's display everything in one single "page";
- Fixed something related to bugreport:1900 (but not only); added a new flag to status_change_clear to include some status as SC_WEIGHT50, SC_PUSH_CART, which shouldn't be removed by sc_end script command. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16948 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c45
-rw-r--r--src/map/status.c13
2 files changed, 45 insertions, 13 deletions
diff --git a/src/map/script.c b/src/map/script.c
index db2c2832e..53dbfae98 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9661,8 +9661,10 @@ BUILDIN_FUNC(getusersname)
if (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > group_level)
continue; // skip hidden sessions
+ /* Temporary fix for bugreport:1023.
+ * Do not uncomment unless you want thousands of 'next' buttons.
if((disp_num++)%10==0)
- clif_scriptnext(sd,st->oid);
+ clif_scriptnext(sd,st->oid);*/
clif_scriptmes(sd,st->oid,pl_sd->status.name);
}
mapit_free(iter);
@@ -9946,29 +9948,46 @@ BUILDIN_FUNC(sc_end)
struct block_list* bl;
int type;
- type = script_getnum(st,2);
- if( script_hasdata(st,3) )
- bl = map_id2bl(script_getnum(st,3));
+ type = script_getnum(st, 2);
+ if (script_hasdata(st, 3))
+ bl = map_id2bl(script_getnum(st, 3));
else
bl = map_id2bl(st->rid);
- if( potion_flag==1 && potion_target )
- {//##TODO how does this work [FlavioJS]
+ if (potion_flag == 1 && potion_target) //##TODO how does this work [FlavioJS]
bl = map_id2bl(potion_target);
- }
- if( !bl ) return 0;
+ if (!bl)
+ return 0;
- if( type >= 0 && type < SC_MAX )
+ if (type >= 0 && type < SC_MAX)
{
struct status_change *sc = status_get_sc(bl);
- struct status_change_entry *sce = sc?sc->data[type]:NULL;
- if (!sce) return 0;
+ struct status_change_entry *sce = sc ? sc->data[type] : NULL;
+
+ if (!sce)
+ return 0;
+
+
+ switch (type)
+ {
+ case SC_WEIGHT50:
+ case SC_WEIGHT90:
+ case SC_NOCHAT:
+ case SC_PUSH_CART:
+ return 0;
+
+ default:
+ break;
+ }
+
//This should help status_change_end force disabling the SC in case it has no limit.
sce->val1 = sce->val2 = sce->val3 = sce->val4 = 0;
status_change_end(bl, (sc_type)type, INVALID_TIMER);
- } else
- status_change_clear(bl, 2);// remove all effects
+ }
+ else
+ status_change_clear(bl, 3); // remove all effects
+
return 0;
}
diff --git a/src/map/status.c b/src/map/status.c
index 9e3b642d6..10431bace 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -8841,6 +8841,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
* 0 - PC killed -> Place here statuses that do not dispel on death.
* 1 - If for some reason status_change_end decides to still keep the status when quitting.
* 2 - Do clif
+ * 3 - Do not remove some permanent/time-independent effects
*------------------------------------------*/
int status_change_clear(struct block_list* bl, int type)
{
@@ -8910,6 +8911,18 @@ int status_change_clear(struct block_list* bl, int type)
continue;
}
+
+ if( type == 3 )
+ {
+ switch (i)
+ {// TODO: This list may be incomplete
+ case SC_WEIGHT50:
+ case SC_WEIGHT90:
+ case SC_NOCHAT:
+ case SC_PUSH_CART:
+ continue;
+ }
+ }
status_change_end(bl, (sc_type)i, INVALID_TIMER);