summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-13 22:29:09 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-13 22:29:09 +0000
commite18a93f9c0c34d680ff98d713ee91a0e7754a025 (patch)
tree23e16db4c54ebe265897cb27a07c1bc63321e191 /src
parent92e99626bb4cb15ecd336a1e1ddb97d0305b5e1d (diff)
downloadhercules-e18a93f9c0c34d680ff98d713ee91a0e7754a025.tar.gz
hercules-e18a93f9c0c34d680ff98d713ee91a0e7754a025.tar.bz2
hercules-e18a93f9c0c34d680ff98d713ee91a0e7754a025.tar.xz
hercules-e18a93f9c0c34d680ff98d713ee91a0e7754a025.zip
HARRO WORLD. GUESS WHO.
- Follow up r16981 -- battle.c --- Moved damage check up, so it doesn't waste time allocating all that stuff. --- Moved t_race2 inside BF_WEAPON block (the only case that uses it) -- status.h --- Changed (struct) weapon_atk wlv from unsigned short to unsigned char, wlv is capped to REFINE_TYPE_MAX which doesn't get anywhere near UCHAR_MAX - mempool.c -- Temporarily disabled (yes, disabled in a very silly way) Sirius_Black's memory pool implementation, not only because its not currently being used, but because it spawns a new thread (and since its not being used, it wastes a thread and the memory it consumes). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17021 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/common/mempool.c6
-rw-r--r--src/common/mmo.h3
-rw-r--r--src/map/battle.c7
-rw-r--r--src/map/status.h3
4 files changed, 14 insertions, 5 deletions
diff --git a/src/common/mempool.c b/src/common/mempool.c
index 35b03034d..5eccbf178 100644
--- a/src/common/mempool.c
+++ b/src/common/mempool.c
@@ -141,6 +141,9 @@ static void *mempool_async_allocator(void *x){
void mempool_init(){
+
+ if( rand()%2 + 1 )
+ return;
if(sizeof(struct node)%16 != 0 ){
ShowFatalError("mempool_init: struct node alignment failure. %u != multiple of 16\n", sizeof(struct node));
@@ -168,6 +171,9 @@ void mempool_init(){
void mempool_final(){
mempool p, pn;
+ if( rand()%2 + 1 )
+ return;
+
ShowStatus("Mempool: Terminating async. allocation worker and remaining pools.\n");
// Terminate worker / wait until its terminated.
diff --git a/src/common/mmo.h b/src/common/mmo.h
index ad2800010..1e3f74b7d 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -213,7 +213,8 @@ enum e_skill_flag
SKILL_FLAG_PERMANENT,
SKILL_FLAG_TEMPORARY,
SKILL_FLAG_PLAGIARIZED,
- SKILL_FLAG_REPLACED_LV_0, // temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0'
+ SKILL_FLAG_REPLACED_LV_0, // temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0',
+ SKILL_FLAG_PERM_GRANTED, // permanent, granted through someway e.g. script
//...
};
diff --git a/src/map/battle.c b/src/map/battle.c
index f79de79f4..3dd2c847e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -420,6 +420,9 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
struct status_data *sstatus, *tstatus;
int i;
+ if( !damage )
+ return 0;
+
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
t_class = status_get_class(target);
@@ -427,10 +430,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
sstatus = status_get_status_data(src);
tstatus = status_get_status_data(target);
s_race2 = status_get_race2(src);
- t_race2 = status_get_race2(target);
- if( !damage )
- return 0;
#define bccDAMAGE_RATE(a){ damage = (int64)damage * (a)/1000;}
switch(attack_type){
case BF_MAGIC:
@@ -495,6 +495,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
}
break;
case BF_WEAPON:
+ t_race2 = status_get_race2(target);
if( sd && !(nk&NK_NO_CARDFIX_ATK) && (left&2) )
{
short cardfix_ = 1000;
diff --git a/src/map/status.h b/src/map/status.h
index 9871128b0..1e9245af2 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -1568,7 +1568,8 @@ struct weapon_atk {
unsigned short range;
unsigned char ele;
#ifdef RENEWAL
- unsigned short matk, wlv;
+ unsigned short matk;
+ unsigned char wlv;
#endif
};