Page 1 of 1

Additional deploy check for mobile inventory stations.

Posted: Sun Mar 15, 2015 4:30 pm
by perrinoia

Code: Select all

function MobileInventoryPack::deployShape(%player, %item)
{
	%team = GameBase::getTeam(%player);
	%client = Player::getClient(%player);

	if($TeamItemCount[%team @ %item] >= $TeamItemMax[%item] && !$build)
	{
		Client::sendMessage(%client, 0, "Deployable Item limit reached for " @ %descr);
		return false;
	}
	if(!GameBase::getLOSInfo(%player, 5))
	{
		Client::sendMessage(%client, 0, "Deploy position out of range");
		return false;
	}
	// No more window shopping! -perrinoia
	%rot = GameBase::getRotation(%player);
	if(getLOSInfo(vector::add($LOS::Position, rotateVector("0 -2.25 1.5", %rot)), vector::add($LOS::Position, rotateVector("2.16 -0.5 1.4", %rot)), 1))
	{
		Client::sendMessage(%client, 0, "Window shopping is no longer permitted.");
		return false;
	}
This code will prevent players from getting inventory stations where map makers did not intend for players to go, such as beneath the terrain, or outside of indoor maps/arenas.

This will also prevent deploying inventory stations in the corner of a room, where it could be used, but could not be seen. Unfortunate side effect, but worth sacrificing, in my opinion.

Re: Additional deploy check for mobile inventory stations.

Posted: Sun Mar 15, 2015 6:47 pm
by KILROY
Nice, I like it!