Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2015, 01:25 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I haven't been ignoring this one..my online time is limited and I've attempted twice to respond to it - without luck...


You can set bitmasks up to represent just about anything..but, looking specifically at the expansion value chart posted (re-posted) above:

Kunark has a bit value of 1 and a bitmask of 1.


A standard ordinal bitmask will usually exclude 0 from its rankings due to the fact that the lowest provable ranking value is 1 - there is no 0's column
in bit representation.

To convert an ordinal bit ranking to bit position, yes, a simple (1 << (ord_val - 1)) should be used. For cases of 0, you would simple prove it by
checking (bool)ord_val == false or ord_val == 0.

SIDENOTE: You can create a positive mask for validating greater than the ordinal ranking by using (~0 << ord_val). C++ doesn't implement bit rotations,
so there is no chance of a wrap-around with a standard bit shift.


In the case of Kunark, converting the 'value' to a bit position in the coded example does indeed produce 0x02 where the mask is 0x01.

However, look at what is being considered: CanUseAlternateAdvancementRank

Since the transformation reflects a greater than positional value, and there is a 'false' return methodology, you really don't want that condition
to be true for an exclusionary check.


There's a lot of systems that I'm not up-to-speed with - this being one of them.

But, looking at what is defined and what is being checked, I think that particular code snippet is correct. That's not to say that there may not be
issues elsewhere (these guys are pretty sharp and usually catch logic errors pretty quick.)
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #2  
Old 09-24-2015, 02:07 PM
Cilraaz
Sarnak
 
Join Date: Mar 2010
Posts: 77
Default

Quote:
Originally Posted by Uleat View Post
Kunark has a bit value of 1 and a bitmask of 1.
Kunark would be the oddity. I hadn't considered it, since Kunark didn't have any AA availability.

Quote:
Originally Posted by Uleat View Post
However, look at what is being considered: CanUseAlternateAdvancementRank

Since the transformation reflects a greater than positional value, and there is a 'false' return methodology, you really don't want that condition
to be true for an exclusionary check.
Perhaps I'm misunderstanding your intended message, but since it returns false on a not true, the result from the bitwise & should be true if the AA is to be visible to the player. Using SoL as an example, since I can break the comparison down to just a nibble, we currently have the bitwise & of the expansion bitmask (0100) and the shifted rank->expansion value (1000):
Code:
0100
1000
----
0000
Throwing a not on that then evaluates true and in turn returns false, even though we obviously want SoL AA to be used if SoL is the enabled expansion

Quote:
Originally Posted by Uleat View Post
There's a lot of systems that I'm not up-to-speed with - this being one of them.

But, looking at what is defined and what is being checked, I think that particular code snippet is correct. That's not to say that there may not be
issues elsewhere (these guys are pretty sharp and usually catch logic errors pretty quick.)
Which snippet do you believe is correct? The one I posted or the one in source. Perhaps the above bit in this reply is wholly unnecessary.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:45 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3