Jump to content

Recommended Posts

    def __RefreshExinvenSlotState(self):
    
        inventory_max = player.GetExtendInvenMax()
                
        for i in xrange(player.INVENTORY_PAGE_SIZE):
        
            slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
            
            if slotNumber >= inventory_max:
                self.wndItem.LockSlot(i)
            else:
                self.wndItem.UnlockSlot(i)    


player.INVENTORY_PAGE_SIZE = 45

but all time
i = 0
what is problem?
 

badass hei GIF

Link to comment
https://metin2.dev/topic/25526-for-i-in-xrange-all-time-zero-why/
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

@WeedHex I know but not working.

normal is ->
for i in xrange(45):
1,2,3,4,5.. 45

but my document is
for i in xrange(45):
0,0,0,0,0...0

 

My files all try

for i in xrange(45):
print(i)

0,0,0,0,0...

and

for i in xrange(45)
print(2*i)

0,2,4,6,8,10...

and

for i in xrange(45)
print(1*i)

0,0,0,0,0,0

and

for i in xrange(45)
print((2*i)/2)

0,0,0,0,0,0

and

for i in xrange(45)
print(i+1)

1,1,1,1,1,1

and

for i in xrange(45)
print(2*i-1)

-1,1,3,5,7

Not Understand Help Please!

badass hei GIF

@WeedHex
I am using Python2.7.
The logic of the code is simple.
what i don't understand is what is preventing it from working properly?

Why doesn't it work properly in these codes:
self.wndItem.LockSlot(i)
self.wndItem.UnLockSlot(i)

Edited by lordsas61

badass hei GIF

  • 5 years later...

search for 

 

Quote

void CSlotWindow::LockSlot(DWORD dwIndex)
{
    TSlot * pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
        return;

    pSlot->dwState |= SLOT_STATE_LOCK;
}
void CSlotWindow::UnlockSlot(DWORD dwIndex)
{
    TSlot * pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
        return;

    pSlot->dwState ^= SLOT_STATE_LOCK;
}

and modify like 

 

Spoiler

void CSlotWindow::LockSlot(DWORD dwIndex)
{
    TSlot* pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
        return;

    SET_BIT(pSlot->dwState, SLOT_STATE_LOCK);
}

void CSlotWindow::UnlockSlot(DWORD dwIndex)
{
    TSlot* pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
        return;

    REMOVE_BIT(pSlot->dwState, SLOT_STATE_LOCK);
}

 

Edited by Ciofolino

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.