What do these function: 5A46BAC8 mean?

Enginseer

Salientia of the Community Patch
Supporter
Joined
Nov 7, 2012
Messages
3,674
Location
Somewhere in California
Code:
function ChopChop(iPlayer, iUnit, iX, iY, iBuild)
	local pPlayer = Players[iPlayer]
	local pUnit = pPlayer:GetUnitByID(iUnit)
	for pUnit in pPlayer:Units() do
		if pUnit:GetUnitClassType() == GameInfoTypes.UNITCLASS_WORKER then
			print("Choppy chop?")
			if (iBuild == GameInfoTypes.BUILD_REMOVE_FOREST) then
				print("No chop?")
				return false
			end
		end
	end
    return true 
end
GameEvents.PlayerCanBuild.Add(ChopChop)

This is my LUA code utilizing the Community Patch DLL. An individual confirmed this coding was correct when his client was able to detect it (Workers couldn't chop forests). As for my client, however it decided to rather ignore it (Workers could still chop forests) and when I attempted to input them in the Live Tuner.
Rgtr567.png

I couldn't figure out why it was doing this at all, was it because the GameEvents.PlayerCanBuild.Add() didn't exist? It couldn't because I was able to add in nonexistent functions with no errors, so I copied the same code and just gave it a rename.
QZHelom.png


Could anyone help shed some light on this issue if they had it before?


Problem resolved: Newest version of Community Patch seems to be causing errors.
 
Back
Top Bottom