• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision153 (tree)
Time2016-09-28 01:32:55
Authorxops-mikan

Log Message

AIにおいて、手榴弾を持っていない状態で「手榴弾投げ」パスの無限ループに突入した際の、バグ(仕様)を再現。

Change Summary

Incremental Difference

--- trunk/ai.cpp (revision 152)
+++ trunk/ai.cpp (revision 153)
@@ -1094,6 +1094,9 @@
10941094 int selectweapon;
10951095 class weapon *weapon[TOTAL_HAVEWEAPON];
10961096 int weaponid, nbs, i;
1097+ pointdata pdata;
1098+ float posy2;
1099+ float atan_rx, atan_ry;
10971100
10981101 for(int i=0; i<TOTAL_HAVEWEAPON; i++){
10991102 weapon[i] = NULL;
@@ -1109,19 +1112,12 @@
11091112 }
11101113 }
11111114 }
1112- if( i == TOTAL_HAVEWEAPON ){
1113- return 2;
1114- }
11151115
1116- //手榴弾を持っていなければ、切り替える
1117- if( i != selectweapon ){
1116+ //手榴弾に切り替えられるなら、切り替える
1117+ if( (i != TOTAL_HAVEWEAPON)&&(i != selectweapon) ){
11181118 ObjMgr->ChangeWeapon(ctrlid, i);
11191119 }
11201120
1121- pointdata pdata;
1122- float posy2;
1123- float atan_rx, atan_ry;
1124-
11251121 //パスと人の高さを取得
11261122 MoveNavi->GetPathPointData(&pdata);
11271123 posy2 = posy + VIEW_HEIGHT;
@@ -1132,6 +1128,24 @@
11321128 //目標地点への角度を求める
11331129 CheckTargetAngle(posx, posy2, posz, rx*-1 + (float)M_PI/2, ry, pdata.x, pdata.y, pdata.z, 0.0f, &atan_rx, &atan_ry, NULL);
11341130
1131+ //手榴弾を持っていなければ
1132+ if( i == TOTAL_HAVEWEAPON ){
1133+ //※手榴弾を持っていない場合でも、このフレームではその方向へ向かせるよう処理する。
1134+ // この処理により、手榴弾を持っていない状態で かつ手榴弾投げの無限ループに陥った場合、手榴弾投げパスの方角を向き続ける。
1135+ // (本家XOPSの仕様)
1136+
1137+ //旋回
1138+ if( atan_rx > 0.0f ){
1139+ ObjDriver->SetModeFlag(AI_CTRL_TURNLEFT);
1140+ }
1141+ if( atan_rx < 0.0f ){
1142+ ObjDriver->SetModeFlag(AI_CTRL_TURNRIGHT);
1143+ }
1144+ ArmAngle();
1145+
1146+ return 2;
1147+ }
1148+
11351149 //旋回
11361150 if( atan_rx > 0.0f ){
11371151 ObjDriver->SetModeFlag(AI_CTRL_TURNLEFT);