cityrpg / CityRPG

A sandbox-simulation styled mod for the game Blockland that simulates the life of a blocky city. Live, build, and thrive in a city made of blocks.
4 stars 3 forks source link

Unable to find object: '0' attempting to call function 'getDamageLevel' #15

Closed LakeYS closed 4 years ago

LakeYS commented 4 years ago
Add-Ons/GameMode_CityRPG4/server/player.cs (126): Unable to find object: '0' attempting to call function 'getDamageLevel'
BackTrace: ->ProjectileData::onCollision->ProjectileData::Damage->[CityRPG_MainPackage]Player::Damage->GameConnectio
n::setGameBottomPrint
Dglider commented 4 years ago

It isn't checking if %client.player exists before running a function on it. Replace line 126

    %health = 100 - %client.player.getDamageLevel();

With this

if(!isObject(%client.player))
    %health = 0;
else
    %health = 100 - %client.player.getDamageLevel();