From f1c27c9a83166aa0df1d0d978d2389c074ab68cd Mon Sep 17 00:00:00 2001 From: pandaemonium Date: Wed, 11 Feb 2009 20:19:58 +0000 Subject: [PATCH] # PvPGN 1.8.0rc2 fix for non-expansion ladder title bug # by Florian 'fw' Weingarten # usage: go to pvpgn-1.8.0rc2 directory and use "patch -p0 < ladder_xml_output_bug.patch" # software: pvpgn # version: 1.8.0rc2 # file: src/d2dbs/d2ladder.c # function: get_prefix() # bug: the character titles in generated d2ladder.xml are incorrect in D2 (not XP). # Dukes are titled as Count, Kings are titled as Dukes, etc. # see https://forums.pvpgn.org/index.php/topic,5547.0.html # reason: the software assumes five acts, which is only correct for expansion # fix: use /4 instead of /5 (well, use macros for it) for non-expansion ladders --- pvpgn/src/d2dbs/d2ladder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pvpgn/src/d2dbs/d2ladder.cpp b/pvpgn/src/d2dbs/d2ladder.cpp index 8ae1a65..4698b26 100644 --- a/pvpgn/src/d2dbs/d2ladder.cpp +++ b/pvpgn/src/d2dbs/d2ladder.cpp @@ -538,8 +538,10 @@ const char * get_prefix(int type, int status, int chclass) static int sex[11] = {0,1,1,0,0,0,0,1,0,0,0}; - difficulty = ((status >> 0x08) & 0x0f) / 5; - + if(type == 0 || type == 1) // D2 + difficulty = charstatus_get_difficulty(status); + else if(type == 2 || type == 3) // D2XP + difficulty = charstatus_get_difficulty_expansion(status); return prefix[difficulty][type][sex[chclass]]; }