Skip to content

Commit 843dcc9

Browse files
committed
Skip integral recoil list for weapons that won't benefit
1 parent 1d6bbbc commit 843dcc9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/db.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3775,20 +3775,21 @@ int vnum_object_weapons_integralcomp(char *searchname, struct char_data * ch)
37753775
continue;
37763776
if (GET_WEAPON_POWER(&obj_proto[nr]) > power && power != 21)
37773777
continue;
3778+
if (!WEAPON_CAN_USE_FIREMODE(&obj_proto[nr], MODE_BF) && !WEAPON_CAN_USE_FIREMODE(&obj_proto[nr], MODE_FA))
3779+
continue;
37783780
if (IS_OBJ_STAT(&obj_proto[nr], ITEM_EXTRA_STAFF_ONLY))
37793781
continue;
37803782
if (!vnum_from_editing_restricted_zone(OBJ_VNUM_RNUM(nr)))
37813783
continue;
37823784

37833785
++found;
3784-
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "[%6ld :%3d] ^c%2d%s ^yIRC:%d^n %s (^W%s^n, ^c%d^n round, modes:^c%s%s%s%s^n%s)%s\r\n",
3786+
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "[%6ld :%3d] ^c%2d%s ^yIRC:%d^n %s (^c%d^n round, modes:^c%s%s%s%s^n%s)%s\r\n",
37853787
OBJ_VNUM_RNUM(nr),
37863788
ObjList.CountObj(nr),
37873789
GET_WEAPON_POWER(&obj_proto[nr]),
37883790
wound_arr[GET_WEAPON_DAMAGE_CODE(&obj_proto[nr])],
37893791
GET_WEAPON_INTEGRAL_RECOIL_COMP(&obj_proto[nr]),
37903792
obj_proto[nr].text.name,
3791-
weapon_types[(GET_WEAPON_ATTACK_TYPE(&obj_proto[nr]) < 0 || GET_WEAPON_ATTACK_TYPE(&obj_proto[nr]) > MAX_WEAP) ? 0 : GET_WEAPON_ATTACK_TYPE(&obj_proto[nr])],
37923793
GET_WEAPON_MAX_AMMO(&obj_proto[nr]),
37933794
WEAPON_CAN_USE_FIREMODE(&obj_proto[nr], MODE_SS) ? " SS" : "",
37943795
WEAPON_CAN_USE_FIREMODE(&obj_proto[nr], MODE_SA) ? " SA" : "",
@@ -4249,6 +4250,8 @@ int vnum_object_weapons_reachweapon(char *searchname, struct char_data * ch)
42494250
continue;
42504251
if (WEAPON_IS_GUN(&obj_proto[nr]))
42514252
continue;
4253+
if (!CAN_WEAR(&obj_proto[nr], WEAR_WIELD))
4254+
continue;
42524255
if (GET_WEAPON_REACH(&obj_proto[nr]) != rating)
42534256
continue;
42544257
if (GET_WEAPON_DAMAGE_CODE(&obj_proto[nr]) < severity && severity != 1)
@@ -4276,7 +4279,9 @@ int vnum_object_weapons_reachweapon(char *searchname, struct char_data * ch)
42764279
IS_OBJ_STAT(&obj_proto[nr], ITEM_EXTRA_TWOHANDS) ? 2 : 1,
42774280
obj_proto[nr].text.name);
42784281
if (GET_WEAPON_FOCUS_RATING(&obj_proto[nr]) > 0) {
4279-
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), " (focus rating ^c%d^n)", GET_WEAPON_FOCUS_RATING(&obj_proto[nr]));
4282+
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), " (focus rating %s%d^n)",
4283+
GET_WEAPON_FOCUS_RATING(&obj_proto[nr]) > 2 ? "^r" : (GET_WEAPON_FOCUS_RATING(&obj_proto[nr]) > 1 ? "^y" : "^c"),
4284+
GET_WEAPON_FOCUS_RATING(&obj_proto[nr]));
42804285
}
42814286
if (obj_proto[nr].source_info) {
42824287
strlcat(buf, " ^g(canon)^n", sizeof(buf));

0 commit comments

Comments
 (0)