Casawir
Inactive Member-
Posts
51 -
Joined
-
Last visited
-
Feedback
0%
About Casawir
Informations
-
Gender
Male
Recent Profile Visitors
1225 profile views
Casawir's Achievements
-
Hide weapon while emotion is acting
Casawir replied to WeedHex's topic in Community Support - Questions & Answers
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 -
"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); }
- 19 replies
-
- 10
-
2 server attr doesnt match with client side map
-
[BUG]Texture(specular)
Casawir replied to CloseSource's topic in Community Support - Questions & Answers
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 -
ShopOffline ken error
Casawir replied to skill178's topic in Community Support - Questions & Answers
He sold this for you he will fix it, if not make sure that noone will make deals with him again. -
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.
-
Hi how can i send vector with elements contained, to client using packets?
-
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?
-
Hi could someone send me their function item_select_cell beacouse mine is choosing 0
-
Improving Speed of compliation
Casawir replied to Casawir's topic in Community Support - Questions & Answers
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, -
Improving Speed of compliation
Casawir replied to Casawir's topic in Community Support - Questions & Answers
Ahh ofc my mistake, your right. -
Improving Speed of compliation
Casawir replied to Casawir's topic in Community Support - Questions & Answers
What do you mean ? Share with us -
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]
-
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
-
Get function from another file
Casawir replied to Casawir's topic in Community Support - Questions & Answers
Yea thank u, I fixed this another way.