X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 235 (tree) |
|---|---|
| Time | 2020-02-25 18:26:05 |
| Author | |
裏技で武器:NONEにしても装弾数:0にならないよう仕様改善、コメント(の記載漏れ)追加
| @@ -853,15 +853,24 @@ | ||
| 853 | 853 | { |
| 854 | 854 | int selectweapon; |
| 855 | 855 | class weapon *weapon[TOTAL_HAVEWEAPON]; |
| 856 | + int lnbslist[TOTAL_HAVEWEAPON]; | |
| 857 | + int nbslist[TOTAL_HAVEWEAPON]; | |
| 856 | 858 | int nbs = 0; |
| 857 | 859 | |
| 858 | 860 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 859 | 861 | weapon[i] = NULL; |
| 862 | + lnbslist[i] = 0; | |
| 863 | + nbslist[i] = 0; | |
| 860 | 864 | } |
| 861 | 865 | |
| 862 | 866 | //武器の情報を取得 |
| 863 | - ctrlhuman->GetWeapon(&selectweapon, weapon); | |
| 867 | + ctrlhuman->GetWeapon(&selectweapon, weapon, lnbslist, nbslist); | |
| 864 | 868 | |
| 869 | + //武器を持っていないにも関わらず、装弾数があるなら切り替えない | |
| 870 | + if( (weapon[selectweapon] == NULL)&&(nbslist[selectweapon] > 0) ){ | |
| 871 | + return 0; | |
| 872 | + } | |
| 873 | + | |
| 865 | 874 | //武器を持っていれば、合計弾数を取得 |
| 866 | 875 | if( weapon[selectweapon] != NULL ){ |
| 867 | 876 | weapon[selectweapon]->GetParamData(NULL, NULL, &nbs); |
| @@ -987,7 +996,7 @@ | ||
| 987 | 996 | } |
| 988 | 997 | |
| 989 | 998 | //武器の情報を取得 |
| 990 | - ctrlhuman->GetWeapon(&selectweapon, weapon); | |
| 999 | + ctrlhuman->GetWeapon(&selectweapon, weapon, NULL, NULL); | |
| 991 | 1000 | if( weapon[selectweapon] == NULL ){ return 0; } |
| 992 | 1001 | weapon[selectweapon]->GetParamData(&weaponid, &lnbs, &nbs); |
| 993 | 1002 |
| @@ -1130,7 +1139,7 @@ | ||
| 1130 | 1139 | } |
| 1131 | 1140 | |
| 1132 | 1141 | //手榴弾を持っているか確認 |
| 1133 | - ctrlhuman->GetWeapon(&selectweapon, weapon); | |
| 1142 | + ctrlhuman->GetWeapon(&selectweapon, weapon, NULL, NULL); | |
| 1134 | 1143 | for(i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 1135 | 1144 | if( weapon[i] != NULL ){ |
| 1136 | 1145 | weapon[i]->GetParamData(&weaponid, NULL, &nbs); |
| @@ -79,7 +79,7 @@ | ||
| 79 | 79 | int weaponid; |
| 80 | 80 | |
| 81 | 81 | //所有する武器オブジェクトを全て取得 |
| 82 | - in_human->GetWeapon(&selectweapon, out_weapon); | |
| 82 | + in_human->GetWeapon(&selectweapon, out_weapon, NULL, NULL); | |
| 83 | 83 | |
| 84 | 84 | //全て調べる |
| 85 | 85 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| @@ -2307,7 +2307,7 @@ | ||
| 2307 | 2307 | //プレイヤーの座標や武器を取得 |
| 2308 | 2308 | myHuman->GetPosData(&x, &y, &z, &r); |
| 2309 | 2309 | myHuman->GetParamData(¶m, &dataid, NULL, &team); |
| 2310 | - myHuman->GetWeapon(&selectweapon, weapon); | |
| 2310 | + myHuman->GetWeapon(&selectweapon, weapon, NULL, NULL); | |
| 2311 | 2311 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 2312 | 2312 | if( weapon[i] != NULL ){ |
| 2313 | 2313 | weapon[i]->GetParamData(&weapon_paramid[i], NULL, NULL); |
| @@ -2723,10 +2723,14 @@ | ||
| 2723 | 2723 | int selectweapon; |
| 2724 | 2724 | weapon *weapon[TOTAL_HAVEWEAPON]; |
| 2725 | 2725 | int weapon_paramid[TOTAL_HAVEWEAPON]; |
| 2726 | + int lnbslist[TOTAL_HAVEWEAPON]; | |
| 2727 | + int nbslist[TOTAL_HAVEWEAPON]; | |
| 2726 | 2728 | WeaponParameter weapon_paramdata; |
| 2727 | 2729 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 2728 | 2730 | weapon[i] = NULL; |
| 2729 | 2731 | weapon_paramid[i] = 0; |
| 2732 | + lnbslist[i] = 0; | |
| 2733 | + nbslist[i] = 0; | |
| 2730 | 2734 | } |
| 2731 | 2735 | int lnbs = 0; |
| 2732 | 2736 | int nbs = 0; |
| @@ -2740,13 +2744,22 @@ | ||
| 2740 | 2744 | int ErrorRange; |
| 2741 | 2745 | |
| 2742 | 2746 | //各種設定やゲーム情報を取得 |
| 2743 | - myHuman->GetWeapon(&selectweapon, weapon); | |
| 2747 | + myHuman->GetWeapon(&selectweapon, weapon, lnbslist, nbslist); | |
| 2744 | 2748 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 2745 | - if( weapon[i] != NULL ){ | |
| 2746 | - if( selectweapon == i ){ | |
| 2749 | + if( selectweapon == i ){ | |
| 2750 | + //メイン武器 | |
| 2751 | + //武器を持っているならその弾数、未所持ならば未所持時の弾数を取得 | |
| 2752 | + if( weapon[i] != NULL ){ | |
| 2747 | 2753 | weapon[i]->GetParamData(&weapon_paramid[i], &lnbs, &nbs); |
| 2748 | 2754 | } |
| 2749 | 2755 | else{ |
| 2756 | + lnbs = lnbslist[i]; | |
| 2757 | + nbs = nbslist[i]; | |
| 2758 | + } | |
| 2759 | + } | |
| 2760 | + else{ | |
| 2761 | + //サブ武器 サブ武器は武器の種類のみ | |
| 2762 | + if( weapon[i] != NULL ){ | |
| 2750 | 2763 | weapon[i]->GetParamData(&weapon_paramid[i], NULL, NULL); |
| 2751 | 2764 | } |
| 2752 | 2765 | } |
| @@ -4173,14 +4186,18 @@ | ||
| 4173 | 4186 | //人が持っている武器もすべて無効にする |
| 4174 | 4187 | int dummy; |
| 4175 | 4188 | class weapon *weaponlist[TOTAL_HAVEWEAPON]; |
| 4176 | - thuman->GetWeapon(&dummy, weaponlist); | |
| 4189 | + int lnbs[TOTAL_HAVEWEAPON]; | |
| 4190 | + int nbs[TOTAL_HAVEWEAPON]; | |
| 4191 | + thuman->GetWeapon(&dummy, weaponlist, NULL, NULL); | |
| 4177 | 4192 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 4178 | 4193 | if( weaponlist[i] != NULL ){ |
| 4179 | 4194 | weaponlist[i]->SetEnableFlag(false); |
| 4180 | 4195 | weaponlist[i] = NULL; |
| 4181 | 4196 | } |
| 4197 | + lnbs[i] = 0; | |
| 4198 | + nbs[i] = 0; | |
| 4182 | 4199 | } |
| 4183 | - thuman->SetWeapon(weaponlist); | |
| 4200 | + thuman->SetWeapon(weaponlist, lnbs, nbs); | |
| 4184 | 4201 | |
| 4185 | 4202 | thuman->SetEnableFlag(false); |
| 4186 | 4203 | sprintf(str, "Delete human[%d].", id); |
| @@ -4198,16 +4215,18 @@ | ||
| 4198 | 4215 | //人がその武器を持っているなら、関連付けを外す(捨てさせる) |
| 4199 | 4216 | int dummy; |
| 4200 | 4217 | class weapon *weaponlist[TOTAL_HAVEWEAPON]; |
| 4218 | + int lnbs[TOTAL_HAVEWEAPON]; | |
| 4219 | + int nbs[TOTAL_HAVEWEAPON]; | |
| 4201 | 4220 | for(int i=0; i<MAX_HUMAN; i++){ |
| 4202 | 4221 | human *thuman = ObjMgr.GetHumanObject(i); |
| 4203 | 4222 | if( thuman->GetEnableFlag() == true ){ |
| 4204 | - thuman->GetWeapon(&dummy, weaponlist); | |
| 4223 | + thuman->GetWeapon(&dummy, weaponlist, lnbs, nbs); | |
| 4205 | 4224 | for(int j=0; j<TOTAL_HAVEWEAPON; j++){ |
| 4206 | 4225 | if( weaponlist[j] == tweapon ){ |
| 4207 | 4226 | weaponlist[j] = NULL; |
| 4208 | 4227 | } |
| 4209 | 4228 | } |
| 4210 | - thuman->SetWeapon(weaponlist); | |
| 4229 | + thuman->SetWeapon(weaponlist, lnbs, nbs); | |
| 4211 | 4230 | } |
| 4212 | 4231 | } |
| 4213 | 4232 |
| @@ -179,7 +179,7 @@ | ||
| 179 | 179 | int Options_KeyConfigID; //!< オプション画面 No.2 キー設定ID |
| 180 | 180 | int Options_KeyConfigCnt; //!< オプション画面 No.2 キー設定カウント(フレーム数) |
| 181 | 181 | char *licenseinfo[OPTIONS_LICENSELINE]; //!< ライセンス文 |
| 182 | - char *licenseinfobuf; | |
| 182 | + char *licenseinfobuf; //!< 表示するライセンス文を保持するバッファー | |
| 183 | 183 | #endif //ENABLE_MENUOPTIONS |
| 184 | 184 | |
| 185 | 185 | void Render3D(); |
| @@ -182,6 +182,8 @@ | ||
| 182 | 182 | |
| 183 | 183 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 184 | 184 | weapon[i] = NULL; |
| 185 | + noweapon_bullets[i] = 0; | |
| 186 | + noweapon_loadbullets[i] = 0; | |
| 185 | 187 | } |
| 186 | 188 | selectweapon = 1; |
| 187 | 189 | selectweaponcnt = 0; |
| @@ -251,6 +253,8 @@ | ||
| 251 | 253 | |
| 252 | 254 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 253 | 255 | weapon[i] = NULL; |
| 256 | + noweapon_bullets[i] = 0; | |
| 257 | + noweapon_loadbullets[i] = 0; | |
| 254 | 258 | } |
| 255 | 259 | selectweapon = 1; |
| 256 | 260 | selectweaponcnt = 0; |
| @@ -366,8 +370,10 @@ | ||
| 366 | 370 | |
| 367 | 371 | //! @brief 武器を設定 |
| 368 | 372 | //! @param in_weapon[] 設定するweaponクラスのポインタ配列 |
| 373 | +//! @param nlnbs[] 武器未所持時の装弾数を設定するint配列 | |
| 374 | +//! @param nnbs[] 武器未所持時の合計弾数を設定するint配列 | |
| 369 | 375 | //! @warning 通常は PickupWeapon()関数 を使用すること |
| 370 | -void human::SetWeapon(class weapon *in_weapon[]) | |
| 376 | +void human::SetWeapon(class weapon *in_weapon[], int nlnbs[], int nnbs[]) | |
| 371 | 377 | { |
| 372 | 378 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 373 | 379 | if( in_weapon[i] == NULL ){ |
| @@ -379,6 +385,8 @@ | ||
| 379 | 385 | weapon[i] = in_weapon[i]; |
| 380 | 386 | } |
| 381 | 387 | } |
| 388 | + noweapon_loadbullets[i] = nlnbs[i]; | |
| 389 | + noweapon_bullets[i] = nnbs[i]; | |
| 382 | 390 | } |
| 383 | 391 | } |
| 384 | 392 |
| @@ -403,6 +411,10 @@ | ||
| 403 | 411 | nowweapon->GetParamData(&id_param, NULL, NULL); |
| 404 | 412 | MotionCtrl->PickupWeapon(id_param); |
| 405 | 413 | |
| 414 | + //未所持時の弾数情報は初期化 | |
| 415 | + noweapon_bullets[selectweapon] = 0; | |
| 416 | + noweapon_loadbullets[selectweapon] = 0; | |
| 417 | + | |
| 406 | 418 | //切り替え完了のカウント |
| 407 | 419 | selectweaponcnt = 10; |
| 408 | 420 |
| @@ -480,11 +492,15 @@ | ||
| 480 | 492 | //! @brief 武器を取得 |
| 481 | 493 | //! @param out_selectweapon 選択されている武器 (0 〜 [TOTAL_HAVEWEAPON]-1) |
| 482 | 494 | //! @param out_weapon 受け取るweaponクラスのポインタ配列 (配列数:TOTAL_HAVEWEAPON) |
| 483 | -void human::GetWeapon(int *out_selectweapon, class weapon *out_weapon[]) | |
| 495 | +//! @param nlnbs[] 武器未所持時の装弾数を受け取るint配列 (配列数:TOTAL_HAVEWEAPON、NULL可) | |
| 496 | +//! @param nnbs[] 武器未所持時の合計弾数を受け取るint配列 (配列数:TOTAL_HAVEWEAPON、NULL可) | |
| 497 | +void human::GetWeapon(int *out_selectweapon, class weapon *out_weapon[], int nlnbs[], int nnbs[]) | |
| 484 | 498 | { |
| 485 | 499 | *out_selectweapon = selectweapon; |
| 486 | 500 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 487 | 501 | out_weapon[i] = weapon[i]; |
| 502 | + if( nlnbs != NULL ){ nlnbs[i] = noweapon_loadbullets[i]; } | |
| 503 | + if( nnbs != NULL ){ nnbs[i] = noweapon_bullets[i]; } | |
| 488 | 504 | } |
| 489 | 505 | } |
| 490 | 506 |
| @@ -676,6 +692,10 @@ | ||
| 676 | 692 | weapon[selectweapon]->Dropoff(pos_x, pos_y, pos_z, rotation_x, 1.63f); |
| 677 | 693 | weapon[selectweapon] = NULL; |
| 678 | 694 | |
| 695 | + //未所持時の弾数情報は初期化 | |
| 696 | + noweapon_bullets[selectweapon] = 0; | |
| 697 | + noweapon_loadbullets[selectweapon] = 0; | |
| 698 | + | |
| 679 | 699 | //スコープモードを解除 |
| 680 | 700 | SetDisableScope(); |
| 681 | 701 |
| @@ -1085,6 +1105,10 @@ | ||
| 1085 | 1105 | if( weapon[i] != NULL ){ |
| 1086 | 1106 | weapon[i]->Dropoff(pos_x, pos_y, pos_z, DegreeToRadian(10)*GetRand(36), 1.5f); |
| 1087 | 1107 | weapon[i] = NULL; |
| 1108 | + | |
| 1109 | + //未所持時の弾数情報は初期化 | |
| 1110 | + noweapon_bullets[i] = 0; | |
| 1111 | + noweapon_loadbullets[i] = 0; | |
| 1088 | 1112 | } |
| 1089 | 1113 | } |
| 1090 | 1114 |
| @@ -1289,6 +1313,10 @@ | ||
| 1289 | 1313 | if( weapon[i] != NULL ){ |
| 1290 | 1314 | weapon[i]->Dropoff(pos_x, pos_y, pos_z, DegreeToRadian(10)*GetRand(36), 1.5f); |
| 1291 | 1315 | weapon[i] = NULL; |
| 1316 | + | |
| 1317 | + //未所持時の弾数情報は初期化 | |
| 1318 | + noweapon_bullets[i] = 0; | |
| 1319 | + noweapon_loadbullets[i] = 0; | |
| 1292 | 1320 | } |
| 1293 | 1321 | } |
| 1294 | 1322 |
| @@ -140,7 +140,9 @@ | ||
| 140 | 140 | float upmodel_size; //!< 上半身描画サイズ |
| 141 | 141 | float armmodel_size; //!< 腕描画サイズ |
| 142 | 142 | float legmodel_size; //!< 足描画サイズ |
| 143 | - class weapon *weapon[TOTAL_HAVEWEAPON]; //!< 武器 | |
| 143 | + class weapon *weapon[TOTAL_HAVEWEAPON]; //!< 武器 | |
| 144 | + int noweapon_bullets[TOTAL_HAVEWEAPON]; //!< 武器未所持時の合計弾数 | |
| 145 | + int noweapon_loadbullets[TOTAL_HAVEWEAPON]; //!< 武器未所持時の装弾数 | |
| 144 | 146 | int selectweapon; //!< 武器A/Bの選択 |
| 145 | 147 | int selectweaponcnt; //!< 武器の切り替えカウント |
| 146 | 148 | int weaponshotcnt; //!< 武器の連射カウント |
| @@ -180,12 +182,12 @@ | ||
| 180 | 182 | virtual void SetTeamID(int id); |
| 181 | 183 | virtual bool GetInvincibleFlag(); |
| 182 | 184 | virtual void SetInvincibleFlag(bool flag); |
| 183 | - virtual void SetWeapon(class weapon *in_weapon[]); | |
| 185 | + virtual void SetWeapon(class weapon *in_weapon[], int nlnbs[], int nnbs[]); | |
| 184 | 186 | virtual int PickupWeapon(class weapon *in_weapon); |
| 185 | 187 | virtual void ChangeWeapon(int id = -1); |
| 186 | 188 | virtual int GetChangeWeaponCnt(); |
| 187 | 189 | virtual int GetWeaponReloadCnt(); |
| 188 | - virtual void GetWeapon(int *out_selectweapon, class weapon *out_weapon[]); | |
| 190 | + virtual void GetWeapon(int *out_selectweapon, class weapon *out_weapon[], int nlnbs[], int nnbs[]); | |
| 189 | 191 | virtual int GetMainWeaponTypeNO(); |
| 190 | 192 | virtual bool GetWeaponBlazingmode(); |
| 191 | 193 | virtual bool ShotWeapon(int *weapon_paramid, int *GunsightErrorRange); |
| @@ -160,8 +160,12 @@ | ||
| 160 | 160 | int Humanindexid = -1; |
| 161 | 161 | int Weaponindexid = -1; |
| 162 | 162 | class weapon *Weapon[TOTAL_HAVEWEAPON]; |
| 163 | + int lnbslist[TOTAL_HAVEWEAPON]; | |
| 164 | + int nbslist[TOTAL_HAVEWEAPON]; | |
| 163 | 165 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 164 | 166 | Weapon[i] = NULL; |
| 167 | + lnbslist[i] = 0; | |
| 168 | + nbslist[i] = 0; | |
| 165 | 169 | } |
| 166 | 170 | |
| 167 | 171 | #ifndef ENABLE_BUG_HUMANWEAPON |
| @@ -238,7 +242,7 @@ | ||
| 238 | 242 | } |
| 239 | 243 | |
| 240 | 244 | //人に持たせる |
| 241 | - HumanIndex[Humanindexid].SetWeapon(Weapon); | |
| 245 | + HumanIndex[Humanindexid].SetWeapon(Weapon, lnbslist, nbslist); | |
| 242 | 246 | } |
| 243 | 247 | |
| 244 | 248 | //発砲フラグを初期化 |
| @@ -270,8 +274,12 @@ | ||
| 270 | 274 | int Humanindexid = -1; |
| 271 | 275 | int Weaponindexid = -1; |
| 272 | 276 | class weapon *Weapon[TOTAL_HAVEWEAPON]; |
| 277 | + int lnbslist[TOTAL_HAVEWEAPON]; | |
| 278 | + int nbslist[TOTAL_HAVEWEAPON]; | |
| 273 | 279 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 274 | 280 | Weapon[i] = NULL; |
| 281 | + lnbslist[i] = 0; | |
| 282 | + nbslist[i] = 0; | |
| 275 | 283 | } |
| 276 | 284 | |
| 277 | 285 | #ifndef ENABLE_BUG_HUMANWEAPON |
| @@ -331,7 +339,7 @@ | ||
| 331 | 339 | } |
| 332 | 340 | |
| 333 | 341 | //人に持たせる |
| 334 | - HumanIndex[Humanindexid].SetWeapon(Weapon); | |
| 342 | + HumanIndex[Humanindexid].SetWeapon(Weapon, lnbslist, nbslist); | |
| 335 | 343 | } |
| 336 | 344 | |
| 337 | 345 | //ログ関係の処理 |
| @@ -2143,7 +2151,7 @@ | ||
| 2143 | 2151 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 2144 | 2152 | weapon[i] = NULL; |
| 2145 | 2153 | } |
| 2146 | - HumanIndex[human_id].GetWeapon(&selectweapon, weapon); | |
| 2154 | + HumanIndex[human_id].GetWeapon(&selectweapon, weapon, NULL, NULL); | |
| 2147 | 2155 | |
| 2148 | 2156 | //何かしらの武器を持っていれば |
| 2149 | 2157 | if( weapon[selectweapon] != NULL ){ |
| @@ -2174,13 +2182,17 @@ | ||
| 2174 | 2182 | |
| 2175 | 2183 | int selectweapon; |
| 2176 | 2184 | weapon *weapon[TOTAL_HAVEWEAPON]; |
| 2185 | + int lnbslist[TOTAL_HAVEWEAPON]; | |
| 2186 | + int nbslist[TOTAL_HAVEWEAPON]; | |
| 2177 | 2187 | int lnbs, nbs; |
| 2178 | 2188 | |
| 2179 | 2189 | //所持している武器を取得 |
| 2180 | 2190 | for(int i=0; i<TOTAL_HAVEWEAPON; i++){ |
| 2181 | 2191 | weapon[i] = NULL; |
| 2192 | + lnbslist[i] = 0; | |
| 2193 | + nbslist[i] = 0; | |
| 2182 | 2194 | } |
| 2183 | - myHuman->GetWeapon(&selectweapon, weapon); | |
| 2195 | + myHuman->GetWeapon(&selectweapon, weapon, lnbslist, nbslist); | |
| 2184 | 2196 | |
| 2185 | 2197 | //現在武器を所有しておらず、新たに持たせる武器もないなら |
| 2186 | 2198 | if( (weapon[selectweapon] == NULL)&&(new_weaponID == ID_WEAPON_NONE) ){ |
| @@ -2193,30 +2205,43 @@ | ||
| 2193 | 2205 | //新しい武器を配置 |
| 2194 | 2206 | dataid = AddVisualWeaponIndex(new_weaponID, false); |
| 2195 | 2207 | |
| 2196 | - //武器が配置できれば、武器を持たせる | |
| 2208 | + //武器が配置できれば | |
| 2197 | 2209 | if( dataid != -1 ){ |
| 2210 | + //武器設定を適用(主に弾数) | |
| 2198 | 2211 | weapon[selectweapon] = &(WeaponIndex[dataid]); |
| 2199 | - myHuman->SetWeapon(weapon); | |
| 2212 | + weapon[selectweapon]->ResetWeaponParam(Resource, new_weaponID, lnbslist[selectweapon], nbslist[selectweapon]); | |
| 2213 | + | |
| 2214 | + //未所持時の弾数情報は初期化 | |
| 2215 | + lnbslist[selectweapon] = 0; | |
| 2216 | + nbslist[selectweapon] = 0; | |
| 2217 | + | |
| 2218 | + //武器を持たせる | |
| 2219 | + myHuman->SetWeapon(weapon, lnbslist, nbslist); | |
| 2200 | 2220 | return true; |
| 2201 | 2221 | } |
| 2202 | 2222 | } |
| 2203 | 2223 | else{ //武器を所有していれば |
| 2224 | + //武器設定を取得(弾数設定を引き継ぐため) | |
| 2225 | + weapon[selectweapon]->GetParamData(NULL, &lnbs, &nbs); | |
| 2226 | + | |
| 2204 | 2227 | if( new_weaponID == ID_WEAPON_NONE ){ //武器を消すなら |
| 2205 | - //一度武器を捨てた上で、その武器を削除 | |
| 2206 | - if( myHuman->DumpWeapon() == true ){ | |
| 2207 | - weapon[selectweapon]->SetEnableFlag(false); | |
| 2208 | - return true; | |
| 2209 | - } | |
| 2228 | + //その武器は削除 | |
| 2229 | + weapon[selectweapon]->SetEnableFlag(false); | |
| 2230 | + | |
| 2231 | + //武器を削除し、弾数を反映 | |
| 2232 | + weapon[selectweapon] = NULL; | |
| 2233 | + lnbslist[selectweapon] = lnbs; | |
| 2234 | + nbslist[selectweapon] = nbs; | |
| 2235 | + myHuman->SetWeapon(weapon, lnbslist, nbslist); | |
| 2236 | + | |
| 2237 | + //スコープモードを解除 | |
| 2238 | + myHuman->SetDisableScope(); | |
| 2210 | 2239 | } |
| 2211 | 2240 | else{ //武器を変更するなら |
| 2212 | - //武器設定を取得(弾数設定を引き継ぐため) | |
| 2213 | - weapon[selectweapon]->GetParamData(NULL, &lnbs, &nbs); | |
| 2214 | - | |
| 2215 | 2241 | //武器設定を適用 |
| 2216 | 2242 | weapon[selectweapon]->ResetWeaponParam(Resource, new_weaponID, lnbs, nbs); |
| 2217 | - | |
| 2218 | - return true; | |
| 2219 | 2243 | } |
| 2244 | + return true; | |
| 2220 | 2245 | } |
| 2221 | 2246 | |
| 2222 | 2247 | return false; |