Ticket #1046: 1046.3.patch

File 1046.3.patch, 1.9 KB (added by maveric, 9 years ago)
  • binaries/data/mods/public/gui/session/unit_actions.js

     
    560560                data.target = targetState.id;
    561561                cursor = "action-repair";
    562562            }
     563            else if (playerCheck(entState, targetState, ["Enemy"]))
     564            {
     565                data.allowCapture = false;
     566                data.target = targetState.id;
     567                data.command = "attack";
     568               
     569                if (hasClass(targetState, "Unit"))
     570                {
     571                    cursor = "action-attack";
     572                }
     573                else if (hasClass(targetState, "Structure"))
     574                {
     575                    if (targetState.foundation)
     576                    {
     577                        cursor = "action-attack";
     578                    }
     579                    else
     580                    {
     581                        cursor = "action-capture";
     582                        data.allowCapture = true;
     583                    }
     584                }
     585            }
    563586
    564587            // Don't allow the rally point to be set on any of the currently selected entities (used for unset)
    565588            // except if the autorallypoint hotkey is pressed and the target can produce entities
  • binaries/data/mods/public/simulation/helpers/RallyPointCommands.js

     
    7070                "queued": true
    7171            });
    7272            break;
     73        case "attack":
     74        {
     75            var cmpUnitAI = Engine.QueryInterface(data[i].target, IID_UnitAI);
     76            if (cmpUnitAI.CheckTargetVisible(data[i].target) && cmpUnitAI.TargetIsAlive(data[i].target))
     77                ret.push( {
     78                    "type": "attack",
     79                    "entities": spawnedEnts,
     80                    "target": data[i].target,
     81                    "allowCapture": data[i].allowCapture,
     82                    "queued": true,
     83                });
     84            break;
     85        }
    7386        case "trade":
    7487            ret.push( {
    7588                "type": "setup-trade-route",