Jump to content

Casawir

Inactive Member
  • Posts

    51
  • Joined

  • Last visited

  • Feedback

    0%

About Casawir

Informations

  • Gender
    Male

Recent Profile Visitors

1225 profile views

Casawir's Achievements

Enthusiast

Enthusiast (6/16)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

18

Reputation

  1. yes i did, but im not proud of my solution, and its not that short, u need to think about many cases what triggers and what can stop emotion ill post it later but its not quality code
  2. "c++11" code, a little bit optimised maybe someone will be interested; void CPythonPlayer::PickCloseItemVector() { CInstanceBase * pkInstMain = NEW_GetMainActorPtr(); if (!pkInstMain) return; TPixelPosition kPPosMain; pkInstMain->NEW_GetPixelPosition(&kPPosMain); CPythonItem& rkItem = CPythonItem::Instance(); std::vector<DWORD> itemlist{ rkItem.GetCloseItemVector(pkInstMain->GetNameString(), kPPosMain)}; if (itemlist.empty()) return; for (auto &i : itemlist) SendClickItemVectorPacket(i); } std::vector<DWORD> CPythonItem::GetCloseItemVector(const std::string & myName, const TPixelPosition & c_rPixelPosition) { DWORD dwCloseItemDistance = 1000 * 1000; std::vector<DWORD> itemlist; for (auto &i : m_GroundItemInstanceMap) { TGroundItemInstance * pInstance = i.second; DWORD dwxDistance = DWORD(c_rPixelPosition.x - pInstance->v3EndPosition.x); DWORD dwyDistance = DWORD(c_rPixelPosition.y - (-pInstance->v3EndPosition.y)); DWORD dwDistance = DWORD(dwxDistance*dwxDistance + dwyDistance * dwyDistance); if (dwDistance < dwCloseItemDistance && (pInstance->stOwnership == "" || pInstance->stOwnership == myName)) { itemlist.push_back(i.first); } } return itemlist; // moving vector not explicit } void CPythonPlayer::SendClickItemVectorPacket(DWORD dwIID) { if (IsObserverMode()) return; CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance(); rkNetStream.SendItemPickUpPacket(dwIID); }
  3. 2 server attr doesnt match with client side map
  4. Addl aplha channel to you texture , do it properly u can see how.to make.it good, opening official armor textures in photoshop or.gimp
  5. He sold this for you he will fix it, if not make sure that noone will make deals with him again.
  6. How can i convert c++ map to python dictionary, for example std::map<std::string, int> mymap; mymap["key1"] = 50; mymap["key2"] = 20; mymap["key3"] = 100; i want to reclaim in python, self.mydictionary["key1"] = 50; self.mydictionary["key2"] = 20; self.mydictionary["key3"] = 100; Is this possible with metin2 included libraries? In worst case i would like to reclaim array as a list, not only get by loop.
  7. Hi how can i send vector with elements contained, to client using packets?
  8. Hi, i have got a problem, when i make alpha channel in my dds texture then my model is transparent in places where alpha channel is maximally black, any solution?
  9. Hi could someone send me their function item_select_cell beacouse mine is choosing 0
  10. With this changes i wrote in tutorial u dont need to change Makefile, but im not sure it might be depended on FreeBSD version. Maybe your problem with small changes is caused of not clearing,deleting .o files before compilation,
  11. Install ccache # cd /usr/ports/devel/ccache && make install clean or # pkg_add -r ccache THEN: # ee /etc/make.conf PASTE IN THIS: .if !defined(NO_CCACHE) CC= /usr/local/libexec/ccache/world-cc CXX= /usr/local/libexec/ccache/world-c++ .endif .if ${.CURDIR:M*/ports/devel/ccache} NO_CCACHE= yes .endif SAVE AND CLOSE. THEN: # ee /.cshrc PASTE IN THIS: # set ccache varibles setenv PATH /usr/local/libexec/ccache:$PATH setenv CCACHE_PATH /usr/bin:/usr/local/bin setenv CCACHE_DIR /var/tmp/ccache setenv CCACHE_LOGFILE /var/log/ccache.log # set ccache temp size to 512MB (default 1GB) if ( -x /usr/local/bin/ccache ) then /usr/local/bin/ccache -M 512M > /dev/null endif SAVE AND CLOSE. THEN: # source /.cshrc RESTART MAY BE REQUIRED With this command we can check usage of memory: # ccache -s MANUAL [Hidden Content]
  12. float time_calc = (time*pkVictim->GetPoint(POINT_IMMUNE_STUN))/100; pkVictim->ChatPacket(CHAT_TYPE_PARTY, "%f, %d", time_calc, pkVictim->GetPoint(POINT_IMMUNE_STUN)); For example: time = 4 - int POINT_IMMUNE_STUN = 90 - int so technically i should get on chat this one: 3.60000 , 90 but instead of this im getting: 3.00000 , 90 any solution? Im newbie in cpp
×
×
  • 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.