Additional deploy check for mobile inventory stations.

Post Reply
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Additional deploy check for mobile inventory stations.

Post 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.
Image
User avatar
KILROY
Posts: 1315
Joined: Sat Apr 05, 2014 8:59 pm
Location: Texas

Re: Additional deploy check for mobile inventory stations.

Post by KILROY »

Nice, I like it!
Post Reply