//===========================================================================// // File: MissileWeapon_Tool.cpp //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // //---------------------------------------------------------------------------// // Copyright (C) 1998, Fasa Interactive // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #include "MW4Headers.hpp" #include "MissileWeapon.hpp" #include "MWTool.hpp" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void MissileWeapon__GameModel::ConstructGameModel(Script *script) { Check_Object(script); // //-------------- // Set up stream //-------------- // MemoryStream *model_stream = script->modelStream; Check_Object(model_stream); model_stream->AllocateBytes(sizeof(MissileWeapon__GameModel)); ProjectileWeapon__GameModel::ConstructGameModel(script); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // bool MissileWeapon__GameModel::ReadAndVerify( MissileWeapon__GameModel *model, ModelAttributeEntry *attribute_entry, const char *data, char **error, int error_buffer ) { Check_Object(attribute_entry); bool result = false; bool valid_data = (*data != '\0'); // //---------------------------------------- //Read in the values from the data entered //---------------------------------------- // result = ProjectileWeapon__GameModel::ReadAndVerify( model, attribute_entry, data, error, error_buffer ); // //--------------------------- //Verify all the model values //--------------------------- // switch(attribute_entry->attributeID) { case BurnTimeAttributeID: { if(!valid_data) { Scalar value = 7.0f; attribute_entry->SetValue(model, &value); result = true; } if(model->burnTime <= 0.0f) { _snprintf( *error, error_buffer, "{[GameData]BurnTime=%f}: value must be > 0!", model->burnTime ); result = false; } break; } } return result; }