Issue information

Issue ID
#547
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Dec 4, 2007 12:57
Last Post
Hercules Elf Bot
Dec 4, 2007 12:57
Confirmation
N/A

Hercules Elf Bot - Dec 4, 2007 12:57

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=547

CODE
//For holding basic status (which can be modified by status changes)
struct status_data {
...
    struct weapon_atk rhw, *lhw; //Right Hand/Left Hand Weapon. Only players have a lhw (hence it's a pointer)
}

...
struct weapon_atk {
    unsigned short atk, atk2;
    unsigned short range;
    unsigned char ele;
};

Is it required somewhere that lhw be a pointer? Because, if not, then this thing would just be someone's poor attempt at 'optimizing the square wheel'.
If my calculations are correct, then this thing saves an amazing amount of '3' bytes of memory! (pointer = 4 bytes). And wastes much more as the memmgr has to maintain that dynamic memory block.