<< >> pass the correct surface id from script
| 1197 | |
| 1198 | //<<<FIXME>>> pass the correct surface id from script |
| 1199 | int CScriptObjectEntity::CreateLivingEntity(IFunctionHandler *pH) |
| 1200 | { |
| 1201 | CHECK_PARAMETERS(2); |
| 1202 | _SmartScriptObject pTable(m_pScriptSystem,true); |
| 1203 | int nSurfaceID=0; |
| 1204 | pH->GetParam(1,*pTable); |
| 1205 | float mass,height,eyeh,sph,rad,grav,aircontrol; |
| 1206 | int collide = 0; |
| 1207 | |
| 1208 | pTable->GetValue("mass",mass); |
| 1209 | pTable->GetValue("height",height); |
| 1210 | pTable->GetValue("eyeheight",eyeh); |
| 1211 | pTable->GetValue("sphereheight",sph); |
| 1212 | pTable->GetValue("radius",rad); |
| 1213 | if (!pTable->GetValue("gravity",grav)) |
| 1214 | grav = 9.81f; |
| 1215 | if (!pTable->GetValue("aircontrol",aircontrol)) |
| 1216 | aircontrol = 0.f; |
| 1217 | if (!pTable->GetValue("collide",collide)) |
| 1218 | collide = 0; |
| 1219 | |
| 1220 | pH->GetParam(2,nSurfaceID); |
| 1221 | |
| 1222 | //<<FIXME>> give the entity system access to the material enumrator |
| 1223 | // nSurfaceID=m_pGame->m_XSurfaceMgr.GetSurfaceIDByMaterialName("mat_meat"); |
| 1224 | |
| 1225 | m_pEntity->CreateLivingEntity(mass,height,eyeh,sph,rad,nSurfaceID,grav,aircontrol, collide!=0); |
| 1226 | |
| 1227 | return pH->EndFunctionNull(); |
| 1228 | } |
| 1229 | |
| 1230 | int CScriptObjectEntity::LoadVehicle(IFunctionHandler *pH) |
| 1231 | { |