Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDA Slots (PDA-slots branch) #48

Open
BlueNexus opened this issue Aug 24, 2015 · 4 comments
Open

PDA Slots (PDA-slots branch) #48

BlueNexus opened this issue Aug 24, 2015 · 4 comments

Comments

@BlueNexus
Copy link
Collaborator

Alright, so PDA slots work fine in every way, except you can't actually put PDA's in them. I've traced the issue back to the items.dm file in objects, under mob_can_equip. Help would be hugely appreciated.

@DJPantheris
Copy link

Did you attempt to set the PDA slot size designation to hold pocketable items and then set the item specific designation to the the definition of the PDA?

@Ryan784
Copy link

Ryan784 commented Aug 24, 2015

As I've been looking into this, I have managed to pinpoint exactly where in the code the PDA is getting stopped from being equipped:

Line 239:
//First check if the item can be equipped to the desired slot.
if("[slot]" in slot_flags_enumeration)
var/req_flags = slot_flags_enumeration["[slot]"]
if(!(req_flags & slot_flags))
return 0

So, I editted the code so it would print out messages to help with debugging:

//First check if the item can be equipped to the desired slot.
if("[slot]" in slot_flags_enumeration)
    H << "<span class='warning'>if('[slot]' in [slot_flags_enumeration]).</span>"
    var/req_flags = slot_flags_enumeration["[slot]"]
    H << "<span class='warning'>Var/req_flags = slot_flags_enumeration('[slot]').</span>"
    H << "<span class='warning'>Var/req_flags == [req_flags].</span>"
    //H << "<span class='warning'>Slot [slot] != Req_flags; Req_flags: [req_flags]; slot_flags: [slot_flags].</span>"
    if(!(req_flags & slot_flags))
        H << "<span class='warning'>if(![req_flags] & [slot_flags]).</span>"
        H << "<span class='warning'>return 0.</span>"
        H << "<span class='warning'>[req_flags] & [slot_flags] not met. More specifically, if(![req_flags & slot_flags]).</span>"
        return 0

So with that in and attempting to equip a PDA, you get this result:

if('23' in /list).
Var/req_flags = slot_flags_enumeration('23').
Var/req_flags == 65536.
if(!65536 & 768).
return 0.
65536 & 768 not met. More specifically, if(!0).
You are unable to equip PDA-Eddie Prevatt (Detective) in slot 23.

So, for whatever reason, the PDA is returning a bitmask of 768, which is the result of both the slot_id and slot_belt flags - so essentially it is ignoring the slot_pda flag.

@Ryan784
Copy link

Ryan784 commented Aug 24, 2015

Further tinkering with it, found the problem: the total bitmask can't be greater than 65535, so essentially the bitmask needs to be less than or equal to 16th bit (32768) for the SLOT_PDA, in setup.

@Lorwp
Copy link

Lorwp commented Sep 4, 2015

Being Fixed in #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants