Beiträge von VegaS

    If i would do it like that, it will return None if the first row is not with the given vnum :o

    "You can do it too, here is just a example."
    I not say to delete the loop, i just showed a better option to return on situation because you did return color, return None etc, isn't compatible on this case my example from quoute of course with your loop


    Python
    1. if itemVnum >= fromVnum and itemVnum <= toVnum:
    2. return color
    3. return None

    I say you can do it simple like this: (I'm speaking just about returning mode

    Python
    1. return color if itemVnum is (itemVnum >= fromVnum and itemVnum <= toVnum) else None
    Zitat von Sanii

    I want to know if theres a better way to check if it is existing in the array.

    I can give you a better option for a dict elements and you can play with this more funny

    Python
    1. def Lookup(conjugateDict, *kwargs):
    2. endOfChain = conjugateDict
    3. for keyData in kwargs:
    4. if isinstance(endOfChain, dict) and keyData in endOfChain:
    5. endOfChain = endOfChain[keyData]
    6. else:
    7. return None
    8. return endOfChain
    Zitat von Sanii

    And maybe i could do: if itemVnum in range(fromVnum, toVnum+1): but i dont like this +1 xD

    Python
    1. import numpy
    2. if (numpy.any((fromVnum <= itemVnum) & (itemVnum <= toVnum))):

    I hope you get my points, i just speaking about more good practices, on progamming never exist a final version of code, everytime we can extended it.
    Good luck.

    Try that and have careful to have the function get_level_dif on source added.

    Python
    1. def GetItemTitleColor(itemVnum):
    2. for fromVnum, toVnum, color in COLORED_ITEMS:
    3. if itemVnum >= fromVnum and itemVnum <= toVnum:
    4. return color
    5. return None

    You can do it too, here is just a example.

    Python
    1. return color if itemVnum is (itemVnum >= fromVnum and itemVnum <= toVnum) else None
    CSS
    1. for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
    2. {
    3. // ..................
    4. m_weaponShiningEffects[0][i] = 0;
    5. m_weaponShiningEffects[1][i] = 0;
    6. }


    The idea isn't so bad, but some things isn't too good, like this one.
    When you can use memset (is useful for intializing a section of memory to some value), without a loop for nothing.

    CSS
    1. memset(m_weaponShiningEffects, 0, sizeof(m_weaponShiningEffects));
    Python
    1. def LoadEffectTable():
    2. for effect in EffectTable:
    3. for i in range(len(EffectTable[effect])):
    4. vnum = effect
    5. effectpath = EffectTable[effect][i]
    6. Shining.Add(vnum, effectpath)


    Should look like this, without killing python.

    Python
    1. def LoadEffectTable():
    2. [Shining.Add(vnum, effectPath.pop(0)) for vnum, effectPath in EffectTable.iteritems()]

    0630 17:19:28578 :: AttributeError
    0630 17:19:28578 :: :
    0630 17:19:28578 :: 'NoneType' object has no attribute 'UpdateRect'


    Search for:

    Python
    1. self.editLine.UpdateRect()
    2. self.editSlot.UpdateRect()
    3. self.board.UpdateRect()

    Replace with this:

    Python
    1. for questObjects in (self.editLine, self.editSlot, self.board):
    2. if questObjects:
    3. questObjects.UpdateRect()

    First one thanks for release again girl, here is a small part for c++ (isn't so beautiful but should working fine, i didn't tested, is a example for who want to do via source and not with quests).
    About to check the type victim killed doesn't have sense in this case because:

    • Type 0 = Monster
    • Type 1 = NPC
    • Type 2 = Stone
    • [....]

    Is enough to check if the killed victim isn't a player.


    Isn't good this check for what you need, and do a loop for that thing to request a packet reloaded just one time for each login is really bad.
    Should look more simple like this:



    Uhm anyway looks ugly this method because will apply for each login every time, you should do a check if he is privileged or not.

    First one thanks for release Bitte melden Sie sich an, um diesen Link zu sehen..
    Here is a version on C++ (not the best, but is ok) if someone want to use.



    Bitte melden Sie sich an, um dieses Bild zu sehen.


    Click on text to get informations.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.
    Bitte melden Sie sich an, um diesen Link zu sehen.

    Informations:


    Zitat

    He has say it

    Thanks for your mention mr. Lawyer. 8o
    Google translate (german-english) is not so good and so i do not read all full, i just read some things.


    Who thought in this category was normal Metin2 players?

    • Bitte melden Sie sich an, um dieses Bild zu sehen.

    It's the first time I see a user metin which comes in a category like this (support metin2 owners) and ask such things like this.

    • What he asked now means is classified in area request of one tool about hacking, he need a special category on forum, something like this: Metin2 Hacks, Bots, Cheats, Exploits & Macros.

    Is not framed this category for him i think but anyway.