core/smn_player.cpp
changeset 756 34c2c73893ee
parent 691 53ec063c462d
child 784 0ff19a8bd981
     1.1 --- a/core/smn_player.cpp	Tue May 08 00:21:44 2007 +0000
     1.2 +++ b/core/smn_player.cpp	Tue May 08 22:26:30 2007 +0000
     1.3 @@ -589,7 +589,8 @@
     1.4  		return pContext->ThrowNativeError("IPlayerInfo not supported by game");
     1.5  	}
     1.6  
     1.7 -	pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), pInfo->GetWeaponName(), NULL);
     1.8 +	const char *weapon = pInfo->GetWeaponName();
     1.9 +	pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), weapon ? weapon : "", NULL);
    1.10  
    1.11  	return 1;
    1.12  }
    1.13 @@ -612,7 +613,8 @@
    1.14  		return pContext->ThrowNativeError("IPlayerInfo not supported by game");
    1.15  	}
    1.16  
    1.17 -	pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), pInfo->GetModelName(), NULL);
    1.18 +	const char *model = pInfo->GetModelName();
    1.19 +	pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), model ? model : "", NULL);
    1.20  
    1.21  	return 1;
    1.22  }