Jump to content
Maintenance ×
×
×
  • Create New...

Walk Through Safezone Without Block


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Today i release a code which you can walk through safezone without block

 

Client Source:

 

GameLib

ActorInstance.h

// Search for:
		BOOL TestPhysicsBlendingCollision(CActorInstance & rVictim);

// Add under:
// #ifdef ENABLE_SAFEZONE_STOP_COLLISION
		BOOL IsInSafe(CActorInstance & ptr);
// #endif

 

ActorInstanceCollisionDetection.cpp

// Search for:
BOOL CActorInstance::TestActorCollision(CActorInstance & rVictim)

// Add before:
// #ifdef ENABLE_SAFEZONE_STOP_COLLISION
#include "../UserInterface/PythonBackground.h"

BOOL CActorInstance::IsInSafe(CActorInstance & ptr)
{
	const TPixelPosition& c_rkPPosCur = ptr.NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, (1 << 2)))
		return true;

	return false;
}
// #endif

// On CActorInstance::TestActorCollision
// Search for:
	if (rVictim.IsDead())
		return false;

// Add under:
// #ifdef ENABLE_SAFEZONE_STOP_COLLISION
	if (IsInSafe(rVictim))
		return false;
// #endif

 

Enjoy.

 

 

  • Metin2 Dev 4
  • Love 13
Link to comment
Share on other sites

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.

	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:

bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

PS: Here is nothing to coding, is just copy 3 lines from other part and put in this part. ", you just copy also them idea and + title name video from rubinum.  i will release a code of mine "

  • Metin2 Dev 1
Link to comment
Share on other sites

On 3/14/2017 at 11:50 PM, Tasho said:

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.

	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:

bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

  Reveal hidden contents

 

 

I create a new bool because in my source i use more code from that what i share here.

I had coded this before a long time ago and i share it now, the idea is not coming from Rubinum2 but they have released a video and show this idea to the community before me.

  • Love 1
Link to comment
Share on other sites

19 minutes ago, Tasho said:

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.

	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:

bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

PS: Here is nothing to coding, is just copy 3 lines from other part and put in this part. " i will release a code of mine "

 

 

Thanks, i will test.

 

https://gyazo.com/a3cdf22b1ee5f262a7fcb5067a24978d

 

do i something wrong?, cause its not work.

  • Love 2
Link to comment
Share on other sites

  • 8 months later...
La 14.03.2017 la 23:50, Tasho a spus:

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.

	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:

bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

PS: Here is nothing to coding, is just copy 3 lines from other part and put in this part. ", you just copy also them idea and + title name video from rubinum.  i will release a code of mine "

Readability

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 0

      erorrs after update granny to 2.9

    2. 0

      Navicat Premium 16.1.1 x64

    3. 5

      problem Dargon Soul Changre Attribute

    4. 5

      problem Dargon Soul Changre Attribute

    5. 41

      Global Chat

    6. 5

      problem Dargon Soul Changre Attribute

    7. 2

      Startup Loading Window Library

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.