Loki_PhoenixWOW
-
Posts
7 -
Joined
-
Last visited
Never -
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Posts posted by Loki_PhoenixWOW
-
-
Anyhow... here's everything updated with a fix for gcc x86_64. And by "fix" I mean I changed the bitset class to store in multiples of sizeof(char) instead of sizeof(long)
src/game/SpellClassMask.h:
src/shared/astd/bitset.h:
http://github.com/Loki-PhoenixWOW/For-MaNGOS/blob/32bd762d7d4dec68df5d28f8a168a6796dac37eb/bitset.h
diff for implementation (may need minor editting for drop-in compatibility):
Enjoy. ~Loki
-
No, advertising in signatures is not ok. I would edit your username too if I had the right.
We definitely will not accept any patch with server advertising anywhere in the files. Author names, maybe but it's generally accepted that we don't change the copyright notice just set the user as the author of the commit. If multiple users need to be thanked they are listed additionally in the commit message.
I would be happy to be just plain Loki, but it was taken =P
I assumed a site link in the sig was ok because the guy who originally complained about it had one in his =P
I'm not a dev for this site, I'm a dev for a server. We're just trying to be good open-sourcey people and give stuff back because we use your code. I fail to understand the logic of the problem. ~Loki
-
Hmm this is failing hard on gcc x86_64... Seems the actual storage sizes for a bitset with gcc are all multiples of sizeof(long). I'll have to include a header for bitsets from something else. ~Loki
-
this seems to be a nice patch indeed, but please remove the advertising, its not liked to be seen on this forum.
saying just this before a mod does.
Moved it to the signature, happy? ~Loki
-
Hmm... doesn't fit... have to do it this way...
src/game/SpellClassMask.h:
SpellCM.diff:
Enjoy. ~Loki
-
Hi, I'm a dev at a private server that's using a MaNGOS-based core now, and we've decided to submit some of our changes back to the community here, in the hope that they will be helpful. Not everything will be drop-in compatible, but most of it should be usable with only minimal editing.
The first thing we'd like to give you guys is a sane way to deal with spell class/family masks. These are 96-bit sets of binary flags that help class spells decide which other spells to affect or be affected by. Currently they're stored alternately as an array of 3 uint32's or a uint64 and a uint32. Also, when they're used in code the flags are hard-coded, making the code hard to read and harder yet to update for new versions and debug.
SpellClassMask.h contains the masks and flags enum'd out for every class, up to date for 3.1.x. These change very little from version to version FYI. It also contains a data type (SpellCM) that can be used as both a std::bitset<96> and an array of 3 uint32's. It uses std::bitset<96> as it's parent class, so all binary ops & << >> ~ etc should work on it as if it were a 96-bit number. See the class definition at the bottom for full details.
SpellCM.diff is the patch that implemented it on our server. You should only need to change a few lines to make it useable. If you look through the file you should be easily able to tell how to use the SpellCM class.
I don't seem to have permission to post attachments, so I guess I'll just paste them in here as replies ~Loki
Sane Spell Class/Family Masks
in OldCore modifications
Posted
Forgot to return *this; from an assignment operator Should be good now.
src/shared/astd/bitset.h:
http://github.com/Loki-PhoenixWOW/For-MaNGOS/blob/642f7bdf9abfd2315f3d0e2cf7c2be00d4dd534c/bitset.h
src/game/SpellClassMask.h
http://github.com/Loki-PhoenixWOW/For-MaNGOS/blob/642f7bdf9abfd2315f3d0e2cf7c2be00d4dd534c/SpellClassMask.h
diff for implementation:
http://github.com/Loki-PhoenixWOW/For-MaNGOS/blob/642f7bdf9abfd2315f3d0e2cf7c2be00d4dd534c/SpellCM.diff
Someone want to tweak the diff so it can drop into your core?
~Loki