Page 1 of 1

Export Error with CameraMsg

PostPosted: Wed Dec 09, 2009 7:15 am
by GPNMilano
Camera Messages seem to have an issue with exporting a cmd of responderundothirdperson and above. It's registering an indexerror of "list index out of range" it traces back this command in prp_Types

Code: Select all
def SetBit(self,index):
        dwordidx = index >> 5 # (Equivalent to index / 32 ) Maximum 32 bits per dword

        if dwordidx >= len(self.data): # append another dword if neccesary
            self.data.append(0x00000000)

        self.data[dwordidx] |= ( 1 << (index & 31)) # (index & 31)  gives the bit index within this dword


it's having trouble etting a bit DWord higher than 32 which responderundothirdperson and others are.

Re: Export Error with CameraMsg

PostPosted: Sun Dec 20, 2009 6:08 am
by Christian Walther
Shot in the dark: This should probably say
Code: Select all
        while dwordidx >= len(self.data): # append more dwords if neccessary

otherwise you can't set bits more than 32 indices higher than the last existing one.

Re: Export Error with CameraMsg

PostPosted: Sun Dec 20, 2009 2:40 pm
by Zrax
Right. In fact, I think I remember finding a similar bug in the hsBitVector of libPlasma, so that's a pretty good bet for the fix.