Ind Posted June 24, 2012 Posted June 24, 2012 I found the following in a old bug tracker issue, moving it to developers chat so it is not lost (again). In all honesty, I'd like to see some areas of the struct map_session_data; object being re-written or re-organized. The whole thing is one big lump of confused and mixed-up values. IE: unsigned int canlog_tick; unsigned int canuseitem_tick; // [skotlex] unsigned int canusecashfood_tick; unsigned int canequip_tick; // [inkfish] unsigned int cantalk_tick; unsigned int canskill_tick; // used to prevent abuse from no-delay ACT files unsigned int cansendmail_tick; // [Mail System Flood Protection] unsigned int ks_floodprotect_tick; // [Kill Steal Protection] Could be condensed down to: struct { unsigned int logout; unsigned int item; unsigned int cashfood; unsigned int equip; unsigned int talk; unsigned int skill; unsigned int mail; unsigned int ks_floodprotect; } tick; That's only an example, there's likely to be a better way to write that block, however the point I'm making is that storing these values in an inline struct makes no difference to performance, it still points to the same memory address. This is definitely something worth looking into. I'd also consider removing a lot of the static types in the structure, such as 'unsigned int' for time tick values, replacing them with system specific 'time_t' values (I believe some operating systems handle this type differently (ulong vs. uint) and it also adds structure/definition to the entire file header). 2 Quote
GreenBox Posted June 24, 2012 Posted June 24, 2012 Totally agree, and not only the MSD can be rewritten. Honestly the entire emulator is a messy(mainly the scripting engine). Quote
clydelion Posted January 8, 2013 Posted January 8, 2013 Heya.. Let's break some diffs and get this implemented xD Did I break something with this? diff only: http://upaste.me/raw/5d73694142303f85 pc.h: http://upaste.me/raw/537769422cc7caf2 Quote
Nameless2you Posted January 10, 2013 Posted January 10, 2013 In favor of this change, go for it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.